Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
Macros in templates
Hi all,
I have a set of macros which are specifically related to a particular template document. Before this, the document has been copied and renamed etc so that the macros within it etc remain with the document. On a trial, we have attempted to use this document as a mail merge template, but have found that the macros in the template do not transfer across to the newly created document, but if you look at it through the VBA editor, they appear to be 'ghosted' with the document, just not accessible in any way. Is there any way to have macros in a template remain active and accessible in a merged document, when the macros absolutely must remain with the document, and not with the normal.dot file? Thanks, -- Wendy |
#2
|
|||
|
|||
First, you probably want to put your macros in your document template, not
in normal.dot. When they are in the document template they will remain available in the documents created from that template so long as the template stays "attached." It will stay attached unless you change the location of your templates (such as by changing servers) or email it around. Second, you can move macros into a document, but that is seldom where you want them. For them to work from within a document, you must have your macro security set to medium or digitally sign the macros (seldom done IME). I just checked and on my system once a merge has been run to a document, macros in the attached template are not available to run. That is I verified your problem. What I would do is put the macros in a global template (not normal.dot) which could be distributed to others using your template. The macros will then be available. You could also put them on a toolbar, also in the global template, which your users could access. (I tried putting them on a custom toolbar in the merge template, but that toolbar was no longer available once I ran the merge.) Note to others giving advice, I also tried reattaching the original template. This did not make the macros or toolbars in the template available in the merge result document "Letters 1." -- Charles Kenyon Word New User FAQ & Web Directory: http://addbalance.com/word Intermediate User's Guide to Microsoft Word (supplemented version of Microsoft's Legal Users' Guide) http://addbalance.com/usersguide See also the MVP FAQ: http://www.mvps.org/word which is awesome! --------- --------- --------- --------- --------- --------- This message is posted to a newsgroup. Please post replies and questions to the newsgroup so that others can learn from my ignorance and your wisdom. "Wendy" wrote in message ... Hi all, I have a set of macros which are specifically related to a particular template document. Before this, the document has been copied and renamed etc so that the macros within it etc remain with the document. On a trial, we have attempted to use this document as a mail merge template, but have found that the macros in the template do not transfer across to the newly created document, but if you look at it through the VBA editor, they appear to be 'ghosted' with the document, just not accessible in any way. Is there any way to have macros in a template remain active and accessible in a merged document, when the macros absolutely must remain with the document, and not with the normal.dot file? Thanks, -- Wendy |
#3
|
|||
|
|||
Thank you for confirming what I was seeing, Charles. I was getting a bit
concerned that I might be doing something wrong. Thank you also for your suggestions, we'll look into final solutions, now we know what we want isn't possible. Cheers, "Charles Kenyon" wrote: First, you probably want to put your macros in your document template, not in normal.dot. When they are in the document template they will remain available in the documents created from that template so long as the template stays "attached." It will stay attached unless you change the location of your templates (such as by changing servers) or email it around. Second, you can move macros into a document, but that is seldom where you want them. For them to work from within a document, you must have your macro security set to medium or digitally sign the macros (seldom done IME). I just checked and on my system once a merge has been run to a document, macros in the attached template are not available to run. That is I verified your problem. What I would do is put the macros in a global template (not normal.dot) which could be distributed to others using your template. The macros will then be available. You could also put them on a toolbar, also in the global template, which your users could access. (I tried putting them on a custom toolbar in the merge template, but that toolbar was no longer available once I ran the merge.) Note to others giving advice, I also tried reattaching the original template. This did not make the macros or toolbars in the template available in the merge result document "Letters 1." -- Charles Kenyon Word New User FAQ & Web Directory: http://addbalance.com/word Intermediate User's Guide to Microsoft Word (supplemented version of Microsoft's Legal Users' Guide) http://addbalance.com/usersguide See also the MVP FAQ: http://www.mvps.org/word which is awesome! --------- --------- --------- --------- --------- --------- This message is posted to a newsgroup. Please post replies and questions to the newsgroup so that others can learn from my ignorance and your wisdom. "Wendy" wrote in message ... Hi all, I have a set of macros which are specifically related to a particular template document. Before this, the document has been copied and renamed etc so that the macros within it etc remain with the document. On a trial, we have attempted to use this document as a mail merge template, but have found that the macros in the template do not transfer across to the newly created document, but if you look at it through the VBA editor, they appear to be 'ghosted' with the document, just not accessible in any way. Is there any way to have macros in a template remain active and accessible in a merged document, when the macros absolutely must remain with the document, and not with the normal.dot file? Thanks, -- Wendy |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
problem printing date and other macros on word templates | Microsoft Word Help | |||
macros, templates and toolbar file copying | Microsoft Word Help | |||
macros in templates in Word 2003 | Microsoft Word Help | |||
Use Templates or Macros? Margins and Full Just. varies in each doc | Microsoft Word Help | |||
Templates in too many languages. Only need English. | Microsoft Word Help |