Is there a way to store custom macros inside a word document? I noticed that when I distribute a document with a macro I made that it arrives "macro-less" and therefore doesn't perform as expected.

I'd like to embed the needed macro inside the document to make it portable.

Perhaps this just isn't possible, but I'm hoping it is.

We use mostly office 2013

  • Hardly this happens that stored Macro can be found,,,, may possible it may produces some error. Could you post the Macro you are trying to store with the file. – Rajesh S Jun 9 '18 at 6:19
  • I don't understand your statement, but the macro is irrelevant, i just want the doc to be portable. The macro is stored separately from the document. – FreeSoftwareServers Jun 9 '18 at 6:21
  • Did yu save the Macro with Template, Or Where it has been? – Rajesh S Jun 9 '18 at 6:26
  • Apparently this is possible! I'd be also welcome to identify how to send a macro separately, although preferably it would be embedded in the document. word.tips.net/T000578_Attaching_Macros_to_Documents.html – FreeSoftwareServers Jun 9 '18 at 20:26

For macros recorded via the Record Macro button.

  • And not assigned to either a button or keyboard shortcut:

  • For macros recorded via Record Macro button and Assign macro to Button selected.

  • For macros recorded via Record Macro button and Assign macro to Keyboard selected:

For macros created by the Macros button make sure in the Macros in dropdown list to select the document itself.

| improve this answer | |
  • Note you can upload images to answers directly, a picture is worth a thousand words sometimes! – FreeSoftwareServers Jun 13 '18 at 2:35
  • Absolutely, unfortunately users with lower rep cannot add images directly, feel free to edit my answer though it would be greatly appreciated. – angelofdev Jun 13 '18 at 4:09

So when using VBA there are two places to store things.

Normal = "Global" to all local Docs, but also local to your machine

Project = "Only this Document" has access to these modules and they are portable AKA Embedded into Document! (Also, unavailable to all other doc's)

Note this image, the module and class are embedded inside the document vs global.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.