7

I have a macro that I developed in Word 2010.

How do I send this to others to use?

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Ann Sanderson
  • 407
  • 3
  • 8
  • 17

4 Answers4

14

From the sublime to the ridiculous, here are four different options:

  1. Create an add-in. Distribute and tell others to install it. Instructions
  2. Create a COM add-in. Distribute and tell others to set a reference to it. Instructions
  3. Export the code module containing your macro to a *.bas file. (Right-click module, Export File...) Distribute and tell others to import it.
  4. Copy-paste macro code into an e-mail. Distribute and tell others to paste it into a module.
Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
5

Save the document as .dotm (macro enabled template). Save it to

%Appdata%/Microsoft/word/startup

Close word. Now, it will be accessible to all other word documents.

If not by default, then go to templates and tick the file saved above

to deploy, create a simple script that copies the file to the appropriate folder. You can probably deploy via email

Rich Tier
  • 9,021
  • 10
  • 48
  • 71
0
  1. Go to the VBA Editor.
  2. Open the Project Explorer if it is not visible (View>ProjectExplorer or Ctrl+R).
  3. If a new module is needed in the project for your file (Project ( _your file_ )),
    • right click on the project and select Insert>Module
    • OR select the project, then on the menu, select Insert>Module.
  4. In the Project Explorer, open Project ( your file )>Modules>ModuleX.
  5. Copy your code into this module.
  6. Save the file as a Word Macro-Enabled Document (*.docm) (File>Save or Ctrl+S).
  7. Distribute the file. The code will now go with it.
Jed Schaaf
  • 1,045
  • 1
  • 10
  • 19
0

I used an old solution - Nullsoft Scriptable Install System to copy the .dotm file to the %Appdata%/Microsoft/word/startup directory. To do this, I set InstallDir in the NSIS script to this:

InstallDir "$APPDATA\Microsoft\Word\Startup"

NSIS creates a small installer in the form of an EXE file that is easy to distribute and easy for users to install.

JustAC0der
  • 2,871
  • 3
  • 32
  • 35