microsoft word macros - nee1983 - nee1983 default page · microsoft® word® 2010 macros spotlight...

2
Microsoft ® Word ® 2010 Macros SPOTLIGHT GUIDE Displaying the Developer Tab To display the Developer tab on the Ribbon: click , then click Options. In the Word Options dialog box, click Customize Ribbon. Under Main Tabs in the right-side frame, check the Developer box . If desired, click the or button to change where the selected tab will appear on the Ribbon. Click OK. Tip: Certain macro commands also appear under the tab. Recording a Macro Once you begin recording a macro, every command clicked and keystroke made is stored as part of that macro. You may wish to avoid routine, non-specific actions (such as using the keyboard to navigate through text) while recording. 1. Under the tab, click Record Macro in the Code group. 2. In the Record Macro dialog box, type a name in the Macro name area and enter details for the new macro as needed. To assign the macro to a Quick Access Toolbar icon: click the Button option. In the Word Options dialog box, select the macro in the left-side frame and click Add. Click the Modify button below to change the macro name and icon if desired. Click OK. To assign the macro to a keyboard shortcut: click the Keyboard option. In the Customize Keyboard dialog box, enter a keyboard shortcut in the Press new shortcut key area. Click Assign, then Close. 3. Your mouse cursor changes to reflect recording status. Complete the actions you want to include in the recorded macro. To pause recording: under the tab, click Pause Recording in the Code group. When you are ready to resume, click Resume Recorder. 4. When finished, click Stop Recording under the tab. Macro Security While macros can be useful for automating legitimate tasks and procedures, they are also a common vehicle for running malicious code on computers. Be wary of opening documents received electronically, especially if they are from an unknown or untrustworthy source. Enabling Macros in a Document When a document containing macros is opened, you may receive a security warning beneath the Ribbon. If the macros are known to be trustworthy (e.g., the document was created by a project team member), click Enable Content to allow them to run. Tip: If unsure, you may want to avoid running macros until you are able to take a closer look at them. See Managing Macros, page 2. Setting Macro Security If security messages appear too frequently or not often enough, you can change your macro security settings to be more useful. 1. Under the tab, click Macro Security in the Code group. 2. The Trust Center dialog box opens. You can also access this screen by clicking , then clicking Options, selecting Trust Center, and finally clicking the Trust Center Settings button. 3. Click the radio button beside the Macro Settings option most ideal for your situation. For example, if you never intend to use macros in your daily work, Disable all macros with notification should safeguard against accidentally running code. If you use many trusted macros and are constantly contending with security messages, a less protective option may make more sense. 4. Click OK. In Microsoft Word 2010, macros are a set of actions performed on a document that can be recorded and repeated later for identical effect. You can play back a macro — an entire set of actions — with one keystroke or click, automating and speeding up repetitive work processes. Some macro features can be hidden in Word by default; make sure to display the Developer tab. Note: Since some basic knowledge of Word 2010 is assumed, those in need of a starter guide are referred to the Word 2010 Quick Reference Guide by Nevada Learning Series. www.nlearnseries.com Macro commands appear in the Code group. Macros can be stored in single documents, or made available for use in all Word documents. Click to assign this macro to a keyboard shortcut. Click to add this macro to the Quick Access Toolbar. Click to allow macros. In some situations, this button is replaced by an Options button, which can be clicked for a menu of possible actions.

Upload: phungliem

Post on 05-Apr-2018

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Microsoft Word Macros - Nee1983 - Nee1983 default page · Microsoft® Word® 2010 Macros SPOTLIGHT GUIDE Displaying the Developer Tab To display the Developer tab on the Ribbon: click

Microsoft® Word® 2010

Macros

S P O T L I G H T G U I D E

Displaying the Developer Tab

To display the Developer tab on the Ribbon: click , then click Options. In the Word Options dialog box, click Customize Ribbon. Under Main Tabs in the right-side frame, check the Developer box . If desired, click the or button to change where the selected tab will appear on the Ribbon. Click OK.Tip: Certain macro commands also appear under the tab.

Recording a MacroOnce you begin recording a macro, every command clicked and keystroke made is stored as part of that macro. You may wish to avoid routine, non-specific actions (such as using the keyboard to navigate through text) while recording.1. Under the tab, click Record Macro in the Code group.2. In the Record Macro dialog box, type a name in the Macro name area and enter details for the

new macro as needed.

To assign the macro to a Quick Access Toolbar icon: click the Button option. In the Word Options dialog box, select the macro in the left-side frame and click Add. Click the Modify button below to change the macro name and icon if desired. Click OK.To assign the macro to a keyboard shortcut: click the Keyboard option. In the Customize Keyboard dialog box, enter a keyboard shortcut in the Press new shortcut key area. Click Assign, then Close.3. Your mouse cursor changes to reflect recording status.

Complete the actions you want to include in the recorded macro. To pause recording: under the tab, click Pause Recording in the Code group. When you are ready to resume, click Resume Recorder.4. When finished, click Stop Recording under the tab.

Macro SecurityWhile macros can be useful for automating legitimate tasks and procedures, they are also a common vehicle for running

malicious code on computers. Be wary of opening documents received electronically, especially if they are from an unknown or untrustworthy source.

Enabling Macros in a DocumentWhen a document containing macros is opened, you may receive a security warning beneath the Ribbon. If the macros are known to be trustworthy (e.g., the document was created by a project team member), click Enable Content to allow them to run.

Tip: If unsure, you may want to avoid running macros until you are able to take a closer look at them. See Managing Macros, page 2.

Setting Macro SecurityIf security messages appear too frequently or not often enough, you can change your macro security settings to be more useful.1. Under the tab, click Macro Security in the

Code group.2. The Trust Center dialog box opens. You can also access

this screen by clicking , then clicking Options, selecting Trust Center, and finally clicking the Trust Center Settings button.

3. Click the radio button beside the Macro Settings option most ideal for your situation. For example, if you never intend to use macros in your daily work, Disable all macros with notification should safeguard against accidentally running code. If you use many trusted macros and are constantly contending with security messages, a less protective option may make more sense.

4. Click OK.

In Microsoft Word 2010, macros are a set of actions performed on a document that can be recorded and repeated later for identical effect. You can play back a macro — an entire set of actions — with one keystroke or click, automating and speeding up repetitive work processes. Some macro features can be hidden in Word by default; make sure to display the Developer tab.

Note: Since some basic knowledge of Word 2010 is assumed, those in need of a starter guide are referred to the Word 2010 Quick Reference Guide by Nevada Learning Series.

www.nlearnseries.com

Macro commands appear in the Code group.

Macros can be stored in single documents, or made available for use in all Word documents.

Click to assign this macro to a keyboard shortcut.Click to add this

macro to the Quick Access Toolbar.

Click to allow macros. In some situations, this button is replaced by an Options button, which can be

clicked for a menu of possible actions.

Page 2: Microsoft Word Macros - Nee1983 - Nee1983 default page · Microsoft® Word® 2010 Macros SPOTLIGHT GUIDE Displaying the Developer Tab To display the Developer tab on the Ribbon: click

For information on customization, visit our website at www.nlearnseries.com/customTo order other guides in our series, please contact us by email ([email protected]) or fax (416-487-3121).Microsoft® Word® 2010: Macros Spotlight Guide copyright ©2012 Nevada Learning Series USA, Inc. We assume no responsibility for errors or omissions in this guide. Word® is a registered trademark of Microsoft®.

ISBN: 978-1-55374-287-6 Printed in the USA

2Working with Macros

Working with Word Keyboard ShortcutsClick , then click Options. In the Word Options dialog box, click Customize Ribbon. At the bottom of the screen, beside Keyboard shortcuts, click the Customize button. In the Categories area, select Macros, then select a macro to view or change associated keyboard shortcuts.

Managing MacrosOpen the Macros dialog box to view and manage active macros.To open the Macros dialog box: under the tab, click Macros in the Code group.

Running MacrosSelect the macro you want to run, then click the Run button. Alternatively, use the keyboard shortcut or Quick Access Toolbar icon you assigned when creating the macro (see Recording a Macro, page 1).

Deleting MacrosSelect the macro you want to delete, then click the Delete button. Click Yes.

Editing MacrosSelect the macro you want to edit, then click the Edit button. The Visual Basic editor opens to display the macro code (see Getting Help with Visual Basic, below).

Creating a Macro Without RecordingType a name for the new macro in the Macro name area, then click the Create button. The Visual Basic editor opens (see Getting Help with Visual Basic, below).

Getting Help with Visual BasicTo take full advantage of macro functionality, Visual Basic knowledge is required. Although writing code is beyond the scope of this guide, the Visual Basic editor contains useful reference material.

Visual Basic Example: Renaming a MacroFrom the Macros dialog box, select the macro you want to rename and click the Edit button. The Visual Basic editor opens.

Visual Basic Example: Calling Another MacroIt is possible to ‘nest’ macros, using one macro to run others as needed. The necessary code will vary depending on where and how the macros are stored.

For macros appearing in the same document, try this line:

call macroname

For macros appearing elsewhere, try:

Application.Run (“macroname”)

Auto MacrosCertain macro names are reserved for automatic action. For example, a macro named AutoExec will automatically run whenever Word is opened. A macro named AutoNew will run when a new document is created. A macro named AutoClose will run when a document is closed.

Organizing MacrosFrom the Macros dialog box, click the Organizer button.

To copy macros: use the drop-down lists to display macros in two different locations (e.g., Document, global template). Select the macro you want to copy and click the Copy button. Click Close.

Use this drop-down menu to view all active macros, or to narrow down the list (e.g., only view macros in the current document).

At the top-right of the screen, type a question or topic into the

box and press the ENTER key.

Change this text — which usually appears on the first line — to rename the macro. Ensure that you don’t delete the syntax brackets following the name! Press CTRL+S to save your changes.