• No results found

Skill Set 4. Macros. By the end of this Skill Set you should be able to: Record a Macro Run a Macro Assign a Macro Create a Multiple Action Macro

N/A
N/A
Protected

Academic year: 2021

Share "Skill Set 4. Macros. By the end of this Skill Set you should be able to: Record a Macro Run a Macro Assign a Macro Create a Multiple Action Macro"

Copied!
9
0
0

Loading.... (view fulltext now)

Full text

(1)

ITQ Level 3

Word Processing Software

Skill Set 4

Macros

By the end of this Skill Set you should be able to:

Record a Macro

Run a Macro

Assign a Macro

(2)

Word Processing Software

ITQ Level 3

Exercise 27 - Recording a Simple Macro

A macro records keystrokes and menu selections, then plays them back exactly as they were recorded. A macro can be created so that a commonly used task can be performed, or a word, phrase or paragraph can be entered automatically. The use of macros results in the more efficient production of documents. Macros can be stored with a document, so they can be used at any time in that document, or stored with a template so they can be used at any time in any document that uses the same template.

A new macro can be created easily, but great care must be taken during the recording, because each action taken is incorporated into the macro.

When saving a document or template that contains macros that are to be used again, they must be saved as a Macro-enabled document or template. These have different file extensions. A .docx document becomes .docm when macros are enabled, whilst a .dotx template becomes .dotm. Macros stored with a document can only be used with that document. Macros stored with a template can be used by any document based on that template.

Activity:

1. Open the Pool Times document. A macro is to be created to enter the pool's name automatically.

2. First, click after the heading and start a new line.

3. Enter the paragraph heading Introduction and press <Enter>.

4. To create the macro, display the Developer tab and click .

Note: If the Developer tab is not on view, select the Office Button and Word Options. From Popular options, select to Show the Developer tab in the Ribbon.

5. Enter the Macro name as LakeView. Display the drop down list for Store macro in. The macro can be stored with the current document, the current template or the default template. Select the current document, Pool Times.

(3)

ITQ Level 3

Word Processing Software

6. Click OK. A Stop Recording macro button is now displayed in the Status

Bar and on the Developer tab (Code group).The mouse pointer changes to a cassette, showing that the macro is now recording all actions performed.

Note: While recording a macro the mouse cannot be used at certain times, for example, when moving the insertion point around within the document or selecting text, the keyboard must be used.

7. Carefully type the text: Lake View Swimming Pool.

8. Click the Stop Recording button, , to end the recording.

Note: To record a macro quickly, click on the Status Bar to display the Record Macro dialog box. Click again where the was, a button to stop the macro recording is now displayed.

9. The macro is now created. To see the programming behind it, click the Macros button, ensure that LakeView is selected from the dialog box then click . Microsoft Visual Basic starts (there may be more than one macro shown).

10. Take a screen print and paste it into your Word document, Dummy Evidence, with a suitable description beneath.

11. Save and close Dummy Evidence, then in the Visual Basic window select

File | Close and Return to Microsoft Word.

12. Click the Office Button and select Save As. Save the file with the name

Pool Times Macro, and a Save as type of Word Macro-Enabled

Document(*.docm).

13. Leave the document open. LakeView

(4)

Word Processing Software

ITQ Level 3

Exercise 28 - Running a Macro

Once a macro has been created and recorded, it can be run at any time.

Activity:

1. At the end of the text Lake View Swimming Pool, type has recently been fully refurbished and we are offering new activities; these are listed below. As well as these new sessions,

2. Click the Macros button from the Developer tab.

3. From Macros in, select Pool Times Macro.docm and select LakeView

from the list.

4. Click Run to insert the text again (adjust spacing if necessary).

5. Complete the sentence by typing still offers its normal swimming timetable.

6. Create a second macro, (in Pool Times Macro.docm), named PrintPage to print a single copy of the current page of the document only (select Office Button, Print, Current page, OK).

7. Run the macro to print a second copy of the page.

8. Save the document(as Pool Times Macro.dotm).

9. Click the Office Button and select Save As. Save the file with the name

Pool Times, as a Word Document(*.docx).

10. Select Replace existing file when prompted.

11. There will be a warning about saving a VBA project (Macro). Read the te xt then click Yes to save as a macro free object. The file will be saved as Pool Times.docx with no macros stored in it.

(5)

ITQ Level 3

Word Processing Software

Exercise 29 - Assigning a Macro

The Customize dialog box can be used to assign a macro to a button on a toolbar. The button can then be added to any toolbar and its appearance can also be changed. A macro can also be assigned to the keyboard, so that it can be run using a key press, or to the Menu Bar as a new menu.

Activity:

1. Open the Pool TimesMacro document, click the Customize Quick Access Toolbar button, , and select More Commands.

Note: Depending on the security level on your computer, documents containing macros may open with a Security Warning stating that macros are disabled. To enable any macros, click the Options button on the warning, select Enable this content and click OK.

2. Display the drop down list in Choose commands from and select Macros.

3. Display the drop down list in Customize Quick Access Toolbar and select

For Pool Times Macro.docm. The customisation will only apply to this document.

4. Select Project.NewMacros.LakeView and click . The macro is added to the list on the right.

5. To change the button’s appearance, click the Modify button.

(6)

Word Processing Software

ITQ Level 3

6. Select from the array of symbols and enter Lake View Macro in the

Display name box. Click OK, then click OK again.

7. Click OK. The new button is displayed on the Quick Access Toolbar (but only for this document).

8. Click the Customize Quick Access Toolbar button, , and select More

Commands.

9. To create a keyboard shortcut for a macro, click the Customize button, .

10. Scroll down the Categories list and select Macros, then select PrintPage

from the list of macros.

11. Select Pool Times Macro.docm from the Savechanges in box.

12. Click in Press new shortcut key and press <Alt L>.

Note: If this key press has already been assigned, try another.

13. Click Assign, Close, then click OK to close the Word Options dialog box.

14. To run the macro press <Alt L>.

15. Test the Lake View button on the Quick Access Toolbar.

16. To remove the Lake View button from the Quick Access Toolbar, right click on the button and select Remove from Quick Access Toolbar.

(7)

ITQ Level 3

Word Processing Software

Exercise 30 - Multiple Action Macros

A macro can be created to combine sequences of actions in a single command, for example to save the document and then close it.

Activity:

1. Using the document Pool Times Macro, create a new macro called

SaveClose, to be stored in the Pool Times Macro document only.

2. Record the following actions: Save the document using the button on the

Quick Access Toolbar, then click the Office Button and select Close. Select Yes at all messages.

3. Stop recording and open the document again. Edit the new macro to view the programming code behind it.

4. Create a screen print and paste it into the Dummy Evidence document. Close the macro code window.

5. Customise the Quick Access Toolbar (for this document only) so that it includes a button ( ) to run the SaveClose macro.

(8)

Word Processing Software

ITQ Level 3

Exercise 31 - Develop Your Skills

1. Open the Toffington document. A macro is to be created to enter your name and the date in the footer.

Note: If previous exercises have not been completed, the sample solution

Toffington26 may be renamed as Toffington and used instead.

2. Select Record Macro from the Developer tab. Name the macro Candidate

and select to store the macro in the Toffington document only.

3. Select the Insert tab and click the Footer button. Select Edit Footer.

4. Type Candidate Name: then your name, press <Tab>, type Date: and then today’s date .

5. Close the Header andFooter view and then stop recording the macro.

6. Assign the macro to a button on the Quick Access Toolbar (again only for this document) and change the button icon to a Smiley Face.

7. Open the Revision Evidence document and create a suitably annotated screen print to show the programming behind the macro.

8. Create a suitably annotated screen print to show the new button on the toolbar.

9. Save the document as a Word Macro-Enabled Document(*.docm).named

Toffington Macro and close all open documents.

Note: In a practical application, it would be more appropriate to include a macro like the one above (and the toolbar button) to the default template so that it was available to all created documents. As this is a tuition exercise, the macro has been kept separate.

(9)

ITQ Level 3

Word Processing Software

Summary: Macros

Your ITQ evidence must demonstrate the following skills:

• Customise menu and toolbars

• Automate common tasks. For example: using macros.

Read through the exercises in this Skill Set to give you some ideas of how you could demonstrate these skills.

References

Related documents

Click on the [Macros] list arrow and choose Stop Recording to finish recording your macro IMPORTANT: when recording a macro, mouse movements made within the document window are

Launch the Macro dialog box by choosing the Tools menu and selecting Macro | Macros… To create a new macro in VBA (not through the macro recorder), type its name into the box

While some of the station located out of urban and located at the palm oil farming area also give some high value in water quality parameters such as NH3N at the station T5..

Stick color rings corresponding to the sectors at one end of the jumper (connected to the feeder) at the position 200 mm away from the jumper connector.. d Bind the

View  Macros  View Macros  (Select MyName)  Run Editing the macro.. Alt

Select New to create a new macro and right click or select the gear icon of a macro to open a menu with Delete and Rename

customer need then solve those same morning of equations or bolster an optimization routine a nature of times using the same model, and word can transcend what happens when read

Rubik allows you to find the order of any macro. Type the macro into the Current Macro input area and press the Macro Order button. The result is displayed in a window. Try