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 / December 2004

Tip: Looking for answers? Try searching our database.

Attach different template in a vba program?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
keith brickey - 17 Dec 2004 22:43 GMT
Is there a way to change to a different template and activate Update styles
from a vba program?

Thanks,

Keith
Charles Kenyon - 17 Dec 2004 23:18 GMT
Yes.

Here's some code from one of my macros that should give you a start.

   With ActiveDocument
       .UpdateStylesOnOpen = True
       .AttachedTemplate = sTemplatesPath & sTemplateName
       .UpdateStylesOnOpen = False
       .AttachedTemplate = sTemplatesPath & sTemplateName
   End With

This attaches the template (described in the variables) updates the styles
and then turns off the updating of styles.

Hope this helps.
Signature


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.

> Is there a way to change to a different template and activate Update
> styles
[quoted text clipped - 3 lines]
>
> Keith
 
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.