Scripting Question

Append a Word Macro

03/28/2016 656 views
I have to deploy an application to 500 users that installs and also create a Word Macro. I know that copying the file to C:\Program Files (x86)\Microsoft Office\Office14\STARTUP will make the Macro available for all users. I thought the issue was resolved until I realized that copying the file will overwrite existing Macros since they are all stored in the file Normal.dotm.

The only other way is to append the exisiting Normal.dotm with the new Macro code using a VBScript but I haven't been able to figure out how to do that. I have tried using Word to append Normal.dotm but it just writes text to it and not as a script to the dotm.

I hope I was able to communicate my question clearly.

Thanks in advance for your help.

EDIT: I should have mentioned. I know how to use a Macro as a global template.

The Macro is stored in a file %appdata%\Roaming\Microsoft\Templates\Normal.dotm which has to be copied to C:\Program Files (x86)\Microsoft Office\Office14\STARTUP\ so when a user launched Word, the Macro is loaded automatically.

I was wondering if there was a way to use VBScript to create a Macro and apparently there isn't.
0 Comments   [ + ] Show comments


Community Chosen Answer

No appending needed, just put the template containing the macro into the Startup folder. It can be named anything you like, but you'd probably want to use a name that identifies its content. If you didn't want to use the Startup folder, you can use any folder you like (how about a network location, so that you don't have to re-distribute it any time that it changes?) and add that location to Word's template location. You'd also have to add that location to Office's "Trusted Locations" but that's easy enough to do, too.
Answered 03/29/2016 by: VBScab
Red Belt

  • It can't be any name. It has to be Normal.dotm otherwise a Word won't read it.
    • My collection of 11 templates must work by magic, then. And what would Microsoft know about anything, eh? Pffffft! https://support.office.com/en-gb/article/Load-or-unload-a-template-or-add-in-program-2479fe53-f849-4394-88bb-2a6e2a39479d?ui=en-US&rs=en-GB&ad=GB&fromAR=1#bm3

All Answers

AFAIK you can only append the actual normal.dotm and deploy that. There is a specific mode for adding / editing macros in Word, I suggest that you do a quick search on google about that. Be aware though, if a user has "customized" their own normal.dotm theses changes will be overwritten..
I found these...
Append a word doc with a macro (see the follow up link)

Also this one (older version of word, but the principle is the same)

I assume that unsigned Macros are allowed in your environment?


Answered 03/29/2016 by: Pressanykey
Red Belt

  • No. If a user adds a custom Macro, it just gets appended to Normal.dotm. I've tested it. And pressing alt F11 while in Word opens up the VBA editor.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ