1
votes

Most of the macros I build for Word essentially run a mail merge, make a copy of the document, then close down the original. We recently upgraded to Office 2010, and since then, the macros I write will run on my machine, but nobody else's (the documents are stored on a shared drive).

I have checked the other user's Trust Center Settings, and they are set to allow macros. I got on someone else's computer and went through the Designer tab to view the VB macro, and I could see the code. The code did not run upon opening though, and I went to File>Info, but couldn't see the "Enable Content" button. It's like it's not even registering that there is a macro.

I tried saving it as .doc and .docm, both work on my computer but not on anyone else's. Old documents that I've created with macros still work on other people's computers, just not the ones I've created in Word 2010.

Any help would be greatly appreciated.

1
Hi Todd. When you wrote these macros did they get recorded to the Normal template, or are they are in their own module? E.g. using the macro recorder will by default record to the Normal template.Ryan Wildry
Looking at the VBA window, I see three Projects: Normal, Project(MOA_KARD) and TemplateProject(ContributeWordUITemplate). I wrote the code under Project(MOA_KARD)>Microsoft Word Objects>ThisDocument.Todd K
Try moving your code to a new module. Hard to tell, but sounds like it's part of your word configuration.Ryan Wildry
I just tried copying an old macro document into the shared drive, and when I opened it from my co-worker's computer, it ran the macro. Then I copied JUST THE TEXT from my new document to the copy, and saved it. Went to my co-workers computer and it wouldn't run the code. It has something to do with what Word 2010 changes when it saves the document.Todd K
Can you post your code?Ryan Wildry

1 Answers

0
votes

It actually took three steps. First, I saved the document as a .docm (instead of .doc). Second, I changed the Sub from "Private Sub" to just "Sub". Finally, I changed the name of the sub from "Document_Open()" to "AutoOpen()". Now everything works as it's supposed to.