0
votes

I'm using Word 2019 and have created macros I want to send to other organisations.

However, when I transfer the document (.docm) or the template (.dotm) the recipient doesn't get the macros (although everything else goes across). On the Developer ribbon, there is no entry for the macro itself or the VBA code.

I know I can export the macro to a *.bas file which the recipient can then import but I'd like to do it directly.
There is no problem with transferring Excel macros but I can't get Word to work. Can anybody help?

1
This is not a programming question, per se. Questions on general usage of Microsoft Word are off-topic for Stack Overflow and should be asked on an appropriate end-user forum. As for the problem itself, that is most likely related to either the recipients' macro-security settings or your the macro being in your installation's Normal template rather than the document or its template.macropod
@macropod note that development/coding related questions can be on-topic too even if there is no code involed directly. E.g. if it is related to "software tools commonly used by programmers;". I don't think this is off-topic becaus it is clearly related to VBA development. The question is about VBA code/coding in general but not about Word in general.Pᴇʜ

1 Answers

0
votes

This is most likely to have 2 possible reasons:

  1. Did you really choose "Word Macro-Enabled Document" as file format? It could be that you saved a normal "Word Document" with the file extension .docm. Note that the file extension does not defined the file format.

    If this happend you have actually a Word document (without macros) but with the wrong file extension .docm. Make sure you choose the correct format not only the correct extension.

    You can easily test this:

    • Save your file as macro enabled file docm.
    • Close Word completely.
    • Re-Open your file. If the macro is still there your file format is correct.
  2. If you send your file via email it can be that your recepient does not allow to recieve macro enabled files, and his email server is stripping off the macro from the Word file.

    If this is the case, then you cannot do much to prevent this. It is in the responsibility of the recepient. The only way to get through this kind of filter is to pack your file into a password protected zip archive so the email server cannot access the Word file. But not that doing so can violate the recepients policies. Also if the reciepient's company did it right they won't allow password protected zip archives via email because the could tunnel through their email filters.

    Best solution in this case it to provide the file via some cloud share (Google Drive, Dropbox, One Drive, what ever, …) and send the recipient a link only.