Results 1 to 2 of 2
Thread: FileSave Macros (Word 2000)
2004-03-15, 23:34 #1
- Join Date
- Apr 2001
- Washington, Washington, USA
- Thanked 0 Times in 0 Posts
FileSave Macros (Word 2000)
I have a number of templates created for a client. A couple of them have FileSave and FileSaveAs procedures to allow the insertion of some document-checking code. That works fine.
Now I need to add FileSave and FileSaveAs code to all the templates (well, those that start with a certain prefix). What is the priority order of macros with the same name? I'm assuming that the attached document template gets priority over a template in the Startup folder (which is where I want to put the code that runs on all the templates). Is that right?
And, is there a way to jump from the FileSave macro attached to the document to then run the OTHER FileSave macro in the global template? I don't want to have to maintain this new code in several templates, but I don't want to move the existing macros to the global template, either. I tried adding this code to the end of the first FileSave module:
but I get an error:
Run-time error '-2147352573 (80020003)': This command is not available.
Any suggestions on how to make this work? Or ideas for another approach? Basically, I need to run the existing FileSave macros if they exist and ALSO run the new FileSave routine housed in a different location (and which will work with all templates, including those without an existing FileSave macro).
As always, many thanks!
2004-03-15, 23:47 #2
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 93 Times in 89 Posts
Re: FileSave Macros (Word 2000)
Microsoft has a KB article on the order that Auto macros execute, and I suspect that the command override macros are similar: if I remember correctly, it is document, attached template, Normal.dot, global templates and add-ins in alpha order.
The Application.Run syntax is tricky. You're probably best off starting from the Module.Procedure and then if that doesn't work, experiment with ! notation rather than . notation to separate the template file name from the module name.
In your global template, it might help if you put the code in a different procedure, such as:
and call that from all of your FileSave procedures.