#1   Report Post  
Wendy
 
Posts: n/a
Default 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   Report Post  
Charles Kenyon
 
Posts: n/a
Default

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   Report Post  
Wendy
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem printing date and other macros on word templates Hitesh Microsoft Word Help 4 April 8th 05 04:49 PM
macros, templates and toolbar file copying TracyB Microsoft Word Help 3 March 14th 05 04:43 PM
macros in templates in Word 2003 Jim Bud Microsoft Word Help 2 January 13th 05 02:09 PM
Use Templates or Macros? Margins and Full Just. varies in each doc LizW Microsoft Word Help 5 December 9th 04 05:43 PM
Templates in too many languages. Only need English. capt_dalton Microsoft Word Help 0 December 2nd 04 10:29 PM


All times are GMT +1. The time now is 09:25 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"