Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

run macro automatically when opening a new doc based on template?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
and - 18 Jan 2005 09:09 GMT
In Word XP, is it possible to have a macro run automatically when I open
a new document based on a given template (user selects the template in
the New Document side pane). How?

The purppose: I would like to have the Mail Merge toolbar to be
displayed always when I open a mailmerge document based on this template.

Is this the right statement to do this:
 objWord.CommandBars("Mailmerge").Visible = True

Best,
ANDy
Jonathan West - 18 Jan 2005 09:58 GMT
> In Word XP, is it possible to have a macro run automatically when I open a
> new document based on a given template (user selects the template in the
> New Document side pane). How?

Give the macro the name AutoNew

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

and - 18 Jan 2005 10:54 GMT
Thanks Jonathan.

And is there a special macro name for procedures that need to be
executed when this document is closed (to hide the Mail Merge toolbar
automatically)?

Best,
 ANDy

> Give the macro the name AutoNew
Jonathan West - 18 Jan 2005 11:52 GMT
> Thanks Jonathan.
>
> And is there a special macro name for procedures that need to be executed
> when this document is closed (to hide the Mail Merge toolbar
> automatically)?

Yes, it is called AutoClose. Take a look in the VBA Help file for "Auto
macros" for more information on this.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Jeff - 18 Jan 2005 12:46 GMT
Read the online Help under "Auto Macros"

Macro name     When it runs
AutoExec     When you start Word or load a global template
AutoNew     Each time you create a new document
AutoOpen     Each time you open an existing document
AutoClose     Each time you close a document
AutoExit     When you quit Word or unload a global template
and - 18 Jan 2005 12:52 GMT
Thanks Jeff.

> Read the online Help under "Auto Macros"

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.