How To Deploy Word 2010 Macros To Others?

前端 未结 4 965
心在旅途
心在旅途 2020-12-17 01:34

I have a macro that I developed in Word 2010.

How do I send this to others to use?

相关标签:
4条回答
  • 2020-12-17 02:20

    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

    0 讨论(0)
  • 2020-12-17 02:21

    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.

    0 讨论(0)
  • 2020-12-17 02:23
    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.
    0 讨论(0)
  • 2020-12-17 02:31

    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.
    0 讨论(0)
提交回复
热议问题