Terry's TMG Tips

Downloading Terry's Word Macro

This page created 29 Feb 2010

Version note: Applies to TMG 8 & 9

This article describes how to download and install the macro I have created for Microsoft Word 2007 to edit Journal reports created in TMG. Instructions are also provided to make minor edits in the macro to adjust it for your needs.

Topics Included in this Article
What it Does
A description of the functions of the macro
Downloading the Macro
Downloading the macro from my website
Installing the Macro
Installing the macro in Word
Editing the Macro
Inserting your name, and other adjustments to the macro

Those who would like to make significant changes to the functions of the macro are probably best served by recording their own macro. My article on Recording Macros in Word 2007 describes how to do that. Readers using a version of older than Word 2007 please see my article for Word97.

Using my macro is a three-step process. The macro is contained in a Word document, which you down load to your computer. You then open that document and transfer the macro to your Word installation. Finally, you make any edits you may choose to the macro, which should at least include inserting your own name so the footers of the reports will carry your name. Those steps are described in detail in the sections below.

What the Macro Does

This macro performs the following formatting changes to Journal reports created with TMG, when they are output in Microsoft Word file format:

For details of the specific margins, font sizes, etc., see the step-by-step instructions used to create the macro in my article on Recording a Word Macro. In order for the macro to work correctly, the reports created in TMG must meet the following specifications:

Obligatory Disclaimer
While I have every reason to believe this macro is safe to use, I cannot accept liability for any adverse consequences. In this litigious world I have to state that it as provided "as is." By downloading it you agree that I am not liable should there be any ill effect whatsoever from downloading or using it.

Downloading the Macro

My macro for formatting TMG Journal reports is contained in a Word document, which can be downloaded here. Save it to any convenient place, such as your desktop.

In yet another misguided attempt by MicroSoft to be helpful, Internet Explorer insists on changing the file extension when you save the file, making it unusable. The best solution is to use a "real" browser, such as Opera or FireFox. But if you prefer to use Internet Explorer you can solve the problem by correcting the extension as you save the file. To do that, when the Save As dialog opens, change the "Save as type" drop-down at the bottom of the screen to "All Files." Then edit the File name just above, changing the ".zip" at the end to ".docm" (for Word Macro-Enabled Document).

Installing the Macro

After you have downloaded the Word document containing the macro, the macro has to be installed into your copy of Word before it can be used. That is done with the following steps.

  1. Open the document you downloaded above into Word, either by double-clicking on it where you saved it, or using the Open command in Word. Depending on the security settings on your installation of Word, you may see a security warning like that shown below between the ribbon and the document. If you do, click the Options button to open the Microsoft Office Security Options dialog box.

Security Warning

In that dialog box, select "Enable this content" and click OK to proceed with the following steps.

Macro Screen
  1. On the View ribbon, in the Macros section at the far right, click the Macros button with the small down arrow on it, and select View Macros to open the Macros dialog box.
View Macro
  1. In the Macros dialog box, click the Organizer button to open the Organizer dialog box.
Macros Screen
  1. In the Organizer dialog box, make sure that the document you downloaded is selected in the drop-down list on the lower left. Select TerrysMacros in the left pane, and click the Copy button to copy that macro to your Normal template. It will then appear in the right pane, as shown below. Click the Close button to close the Organizer dialog.

Organizer screen

  1. Close Word, and when prompted that changes have been made that affect the global template, do you want to save them, click Yes (the changes are that the macro is being saved to your normal template). You may not get this prompt if other copies of Word are open.

  2. To conveniently use the macro, you need to attach it to a button on the Quick Access toolbar, or assign a keystroke combination to it. To do that, open Word again, to a blank document. Click the Office "orb" at the upper left corner, and at the bottom of the menu click Word Options to open the Word Options dialog box.

  3. I recommend adding the macro to the toolbar. To do that, in the Word Options dialog, click Customize in the column on the left. Then, in the "Choose commands from" drop-down, choose Macros. Select the imported macro as shown below, and click the Add button to add it to the toolbar. You can arrange it on the bar with the up and down buttons on the right side of the dialog box.

Word Options screen

  1. If you want a different button icon than the default one shown, select the macro in the list on the right, and click the Modify button below (dimmed in the screenshot above because the macro is not selected in that list). In the Modify Button dialog that opens select a suitable button image. Click OK until all the dialog boxes are closed.

  2. If you prefer to assign the macro to a keyboard shortcut, instead of adding it to the toolbar as shown above, click the "Keyboard shortcuts" Customize button at the lower left of the same dialog box to open the Customize Keyboard dialog box, and make your assignment there.

The macro is now installed in your copy of Word, but we still have one step left to make it useful – making at least one edit to it; more if you prefer.

Editing the Macro

Before it can be used, at least one edit to the macro is needed - inserting your name so that it appears in the footers of reports. To do that, follow the steps below:

  1. On the View ribbon, in the Macros section at the far right, click the Macros button with the small down arrow on it, and select View Macros as you did in Step 2 in "Installing the Macro," above, to open the Macros dialog box.

  2. In the Macros dialog, select the macro in the list, then click the Edit button to open the Visual Basic editor.
Macro edit
  1. In the Visual Basic editor, scroll the main window down a bit past half way (notice the position of the scroll bar slider in the screenshot below) until you see the note in green text indicating where the name should be entered. Replace the text selected in the screenshot below with your name, as you want it to appear in the footnotes of your reports.
Visual Basic Editor
  1. When you have completed the edits, use the File > Close and Return to Microsoft Word command to close the editor. When you exit Word, confirm again that you want to save changes to the Normal template in order to save your changes.

Other edits to the macro are quite possible, for example changes to the margins, font sizes, and similar parameters included, or even deleting entire functions in the macro. Making such changes requires finding the places where they are specified in the macro code and making the required edits. That task may be made somewhat easier by referring to the step-by-step instructions used to create the macro in my article on Recording a Word Macro. As an aid in locating specific sections I have entered comments into the macro code showing where code associated with each of the section headers in that article starts. However, making significant changes by editing the macro is daunting. It may well be easier to record you own macro with the features you want, as described in that article.

ReigelRidge Home Terry's Tips Home Contact Terry



Copyright 2000- by Terry Reigel