Macros on Buttons

If you've been recording your own macros (as explained in past issues of Editorium Update), you may be interested in putting them on toolbar buttons for easy access. Here's how:

1. Make sure the toolbar you want to use is showing. (You may need to click the "View" menu, click "Toolbars," and then put a checkmark next to the toolbar you want to display.)

2. Click the "Tools" menu.

3. Click "Customize."

4. Click the "Commands" tab. (In Word 6 or Word 95, click the "Toolbars" tab.)

5. In the "Categories" list, on the left, click "Macros."

6. In the "Commands" list ("Macros" list in Word 6 or Word 95), on the right, click the macro you want to use and hold down the mouse button.

7. Drag the gray rectangle (representing a toolbar button) to a suitable position on the toolbar you want to use. (In Word 97 or later, a black "I-beam" will indicate the position of your new button.)

8. Release the mouse button. A new button will appear on the toolbar. (In Word 97 or later, it will display the name of the macro.)

9. In Word 6 or 95, click the icon you want to use, or type in the text for a text button. Then click the "Assign" button.

10. In Word 97 or later, click the "Modify Selection" button or right-click the toolbar button you just added. A menu will appear. (In Word 6 or Word 95, you can display the menu by right-clicking the toolbar button.)

11. Use the menu items to change the appearance of your button until you're happy with it (see the explanations below).

12. When you're finished, click the "Close" button.

Now you can click the button to run your macro from the toolbar.

Here's an explanation of the items on the "Modify Selection" menu (some of these are not available in Word 6 or Word 95):

* "Delete" deletes the selected button.

* "Name" lets you change the text displayed on the button (without affecting the name of the macro).

* "Copy Button Image" copies the icon from a selected button.

* "Paste Button Image" pastes a copied icon to a selected button.

* "Reset Button Image" resets a button to its default appearance, which is blank for a new button to which you've assigned an icon.

* "Edit Button Image" lets you create your own icons or modify existing ones. Be careful; it's easy to spend hours playing around in here.

* "Change Button Image" lets you select one of Word's built-in icons. I frequently use the smiley face to run a quick-and-dirty macro for a particular project.

* "Default Style" displays only the icon for a button that has both an icon and a text name.

* "Text Only (Always)" displays only the button's name, hiding the icon if you've assigned one.

* "Text Only (In Menus)" displays only the button's name if you drag the button to a menu rather than a toolbar (yes, you can do that).

* "Image and Text" displays both the icon and the button's name.

* "Begin a Group" separates the button from previous buttons with a space (in Word 6 or Word 95) or a thin, gray line.

* "Assign Hyperlink" lets you use the button to link to a Web page, a file, a picture, or other items, but that's a topic for another day.

When you close Word, the program will ask if you want to save the changes you've made to the Normal (or other) template. In other words, do you want to keep the button you've added? If you do, click yes (this will also save any other changes you've made to the template).

Creating Add-in Templates

If you've been recording your own macros, as explained in our past several newsletters, you've probably been saving them in your Normal template, where they'll be available to use with any document. The Normal template may not be the best place to save them, however. Since it's used a lot, it can become corrupt. (You should back up your Normal template frequently.) Also, saving macros in your Normal template makes it hard to keep them organized.

What's the alternative? Create your own add-in templates as a place to keep your macros. Doing so has several advantages:

1. It makes organizing your macros easy. You can keep all the macros for a particular project or task in a single add-in template.

2. It makes backing up your macros easy. Just keep copies of your templates in several locations.

3. It makes sharing your macros easy. Just give a copy of a template to a colleague or friend.

For information on how to use add-in templates, please see the past two issues of Editorium Update:

http://www.topica.com/lists/editorium/read/message.html?mid=1707012536

http://www.topica.com/lists/editorium/read/message.html?mid=1707100224

So how do you create an add-in template? Here's the way I like to do it:

1. Create a new document in Microsoft Word.

2. Save the document as a Microsoft Word template, which has a ".dot" extension. Be sure to give it a name that describes the purpose of the macros you're going to store in the template (for example, Cleanup.dot or MyProject.dot).

3. Click the "Tools" menu.

4. Click "Macro" and (in Word 97 or later) "Macros."

5. Click the "Organizer" button.

On the "Macro Project Items" tab, you'll see two windows. The name of the template you just created should be displayed above the left window, which should be empty since the template doesn't contain any macros yet. If the name of your template isn't displayed, click the drop-down list under the window and select it.

The window on the right should show the macros available in Normal.dot (as indicated above the window). If the window isn't displaying Normal.dot, click the drop-down list under the window and select it. Then, do this:

1. Select the macros in Normal.dot that you want to copy to your new template. (To select several at once, hold down the CTRL key while clicking the macro names.)

2. Click the "Copy" button. The macros should now be displayed in the left window as being in your new template. (You can also delete or rename macros if you like.)

3. Click the "Close" button.

4. Save your new template, which now contains the macros you copied to it.

You've just created your own add-in template containing your own macros.

Adding a Template Automatically

In upcoming issues of Editorium Update, I'll explain how to run macros by adding your own toolbar buttons, menu items, and keyboard combinations to Microsoft Word. If you want to get a head start, however, be sure to read today's Readers Write column, where subscriber David M Varner explains the importance of using keyboard combinations ("hot keys") and how to create them. Thanks, David!

Last week I explained how to add macros to Microsoft Word in a "global template" or "add-in." You can read last week's newsletter here:

http://www.topica.com/lists/editorium/read/message.html?mid=1707012536

The problem is, every time you start Word, you'll have to reactivate the global template before you can use its macros. Here's the procedure:

1. Click the "Tools" menu (the "File" menu in earlier versions of Word).

2. Click "Templates and Add-ins" ("Templates" in earlier versions of Word).

3. In the list of global templates and add-ins, put a checkmark in the checkbox for the template you want to use.

4. Click the "OK" button.

Wouldn't it be nice, though, if you could have Word add the template automatically? You can. Just follow this procedure:

1. Close Microsoft Word.

2. Copy the template you want to add automatically.

3. Navigate to Word's Startup folder.

4. Paste the template into the Startup folder.

5. Restart Microsoft Word.

The macros in the template should now be available for you to use, and they'll be available automatically every time you start Word.

If you don't know where the Startup folder is, here's how to find out:

1. Click the "Tools" menu (in any version of Word).

2. Click the "Options" menu item.

3. Click the "File Locations" tab.

You'll see the location of the Startup folder on the line labeled "Startup." (If you can't see the full path to the folder, click the "Modify" button.)

_________________________________________

READERS WRITE

David M Varner wrote:

Thank you for your recent information on macros. They are a big key to saving critical time on editorial tasks. I know that my assignments frequently incur midstream revisions; more accurately, frequent revisions (to subject matter as well as format) are the rule. So while macros may take a little time to create, you can zoom through those revisions so quickly that it is well worth knowing this function well. Glad to see your focus on macros.

I disagree, however, with your implicit vote for using Word's menu to implement macros. Sorting through menu items is generally somewhat awkward, especially with time constraints always looming. A pretty good short circuit for this snare is to use hot keys. Even if you prefer mousing in the menu, hot keys are a wonderful snap by comparison when considering time, and possibly crucial when a deadline is close. Having a stable of custom macros is not a bad idea either, if not inevitable.

Not only can you choose to assign hot keys while you are creating a macro, but you can also create hot keys for existing macros. I discovered the latter a couple of years ago while trying to remember the hot keys I had assigned to a certain macro. To my dismay, the answer was not to be found in the Macros dialog box--a strange oversight.

This oversight was so strange, in fact, I was convinced that macro hot-key assignments still must exist somewhere. Well, they do, and their location was not obvious, but not too far away. In short, I found them in the "Customize" dialog box. So, to find the forgotten hot keys you assigned to a macro:

1. Click "Tools" on the menu, then select "Customize" to access the "Customize" dialog box.

2. Click the "Keyboard" button to access the "Customize Keyboard" dialog box.

3. In the "Categories" field, scroll down to and select "Macros."

4. In the "Macros" field, scroll, if necessary, down to the macro you want and select it. Your assigned hot keys now appear in the "Current keys" field.

You can probably now figure out how to assign (or modify) hot keys to existing macros using the "Customize Keyboard" dialog box: Using the "Press new shortcut key" field, select "Ctrl," "Alt," and/or "Shift" keys in combination with other keyboard characters to make that hot-key assignment.