Deploy your Word macros from a central location

Power User Corner

By Colin Wilcox

A number of people have asked how they can deploy their Word macros from a central network location. This column shows you how, from the ground up.

Applies to
Microsoft Word 2002

See all Power User columns
See all columns

Recently, a reader asked whether she could deploy a set of Microsoft Word macros from a central network location. She wanted everyone in her department to use a common set of macros to help ensure uniform document formatting and to speed the formatting process.

Yes, you can. However, before we explain how to distribute your macros, you need to remember one key fact: Word macros always reside in document templates. To share a macro with other users, you have to distribute the template that contains the macro. You can distribute a template in a couple of ways, including:

  • Send the template to others by using e-mail  Each user can then save the template in the correct folder. Typically, the "correct" folder is the \Startup folder, which contains the files that Word opens automatically on startup. Steps later in this column explain how to locate your \Startup folder. This column assumes that you know how to attach a file to an e-mail message to distribute it.
  • Place your macros in a template and save that template on a network server  You can then configure each user's instance of Word to use the template globally. The steps in this column explain how to create a new template, save it to a network location, add macros to that template, and then configure Word to use the template globally. When you take those steps, your macros can work seamlessly with the templates that you apply to your documents.

No matter how you choose to distribute your templates, you should set a high level of macro security. Keep this fact in mind: By default, Word runs unsigned (and therefore potentially unsafe) macros that reside in your \Startup folder, regardless of the folder's location. For more information about trusted folders, see The Office security settings in depth. For information about using macros with greater safety, see Use Office security features to increase macro safety.

Create and distribute a template

Before you go any farther, decide how you want to distribute your template. If you want to save the template in a network location, you need to create that location now. If necessary, work with your Information Technology (IT) department to create the location. (Your IT department may refer to the location as a network share, or just a share.) You may also want to establish access permissions that protect the template and its macros from unauthorized changes.

To create a template
  1. Start Word and open a new, blank document.
  2. On the File menu, click Save As.
  3. In the File name box, type a name for the template. Make the name intuitive. For this exercise, name the file global_macros.
  4. From the Save as type list, select Document template (*.dot). At this point, you can do one of the following:
    • Save the template locally and send it to others as an attachment in e-mail.
    • Save the template to your network location. To do so, follow these steps:
      1. On the Save in list, navigate to your network location.
      2. Click Save and then close the template. When asked whether you want to save your changes, click Yes.

Add macros to a template

Word provides two ways to add macros to a template. You can add them directly, or you can import existing macros from other documents or templates. The steps in the following sections explain how to do either one. Again, you must make sure that you use macros at a high level of security. For more information about doing so, see Use Office security features to increase macro safety.

If you have experience with writing macros in Microsoft Visual Basic®, you can create a new macro and add it to your template.

To add a new macro to the template
  1. Open
  2. On the Tools menu, point to Macro, and then click Visual Basic Editor.
  3. In the Project window, under Template Project (Global_Macros), double-click ThisDocument.
  4. Write your new macro. If you want to use an easy example instead of writing a new macro, copy and paste this block of code into the code window:
Sub Global_Macro_Test()
   MsgBox "This is a global macro test."
End Sub
  1. Save the macro.
  2. Quit the Visual Basic Editor.

When you share existing macros among templates and documents, you do so by exporting them from a source file and then importing them into a destination file. You can use these steps whenever you need to share existing macros with your coworkers.

To add an existing macro to the template
  1. Open the document or template containing the macro that you want to export.
  2. On the Tools menu, point to Macro, and then click Macros.
  3. Select the macro that you want to export, and then click Edit. The Visual Basic Editor starts and opens the code module for the macro.
  4. On the File menu in the Visual Basic Editor, click Export File. The Export File dialog box appears.
  5. In the Save in list, locate the folder that contains, and then click Save to save the code module in that location. If it helps, you can give the module an easy-to-remember name.
  6. Open, press ALT+F11 to start the Visual Basic Editor there, and then, on the File menu, click Import File.
  7. Navigate to the folder that contains, click the module that you just exported, and then click Open.
  8. Save the module, quit the Visual Basic Editor, and then quit Word.

Configure Word to use the template globally

You follow a two-phase process to configure Word to use your template globally. First, you change the path to the location of the files that Word loads on startup. Second, you add the global_macros template to the list of global templates in Word. Anyone on the network who wants to use the global_macros template has to follow these steps.

To change the location of the startup files
  1. On the Tools menu in Word, click Options, and then click the File Locations tab.
  2. Under File types, select Startup, and then click Modify. The Modify Location dialog box appears.
  3. From the Look in list, navigate to the location of, and then click OK.
  4. Click Close.

This change enables Word to load the template automatically at the start of each session.

To add the template to the list of global templates
  1. On the Tools menu, click Templates and Add-ins.
  2. In the Templates and Add-ins dialog box, click Add.
  3. Navigate to, and then click OK.
    The template appears in the Checked items are currently loaded list, and Word automatically selects the check box next to the template name, as shown in this illustration.

The Templates and Add-ins dialog box

Selecting the check box enables Word to make the macros in the template available for use in all of your documents. If you need to discontinue using the template, clear the check box.

Repeat these sets of steps as needed for each of the users who require the template.

Here's a bit of background information about this process: Whenever you create a new document, Word applies a template to that new file. By making the macros template available globally, you enable Word to aggregate those macros together with the template that is attached to the document (usually The effect is seamless, meaning that the user sees the macros as though they reside in the document.

A note about testing and security

If you're going to deploy macros from a central share, consider setting up a test environment and testing any macros there before you deploy them to a large group of users. You don't need to do anything complicated. For example, you or your IT department can create a share with limited access. You can place a copy of your macro template on that share and then test any new macros there.

Finally, you should implement a high level of security for the template as well as for your macros. For example, you can assign read-only permissions to everyone except those people with the right to add or change the macros in the template. For more information about increasing macro security while using network locations, see Using Office Security Features with Your Default Folders.

Keep those e-mail messages coming

We look forward to receiving your e-mail messages at We want this to be your column, so send us your comments and favorite handcrafted Office solutions. Remember, we can't feature every solution that we receive, we can't respond to all of your letters, and we are not technical support representatives. However, we may feature your solution or answer your question in an upcoming column.

About the author

Colin Wilcox writes for the Office Help team. In addition to contributing to the Office Power User Corner column, he writes articles and tutorials for Microsoft Data Analyzer.

See all Power User columns
See all columns