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 2006

Tip: Looking for answers? Try searching our database.

Automatically updating templates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Doug - 15 Dec 2006 22:01 GMT
Does anyone know of a tool that can search for documents that have a
particular template attached and automatically attach a new template, in the
process updating the styles and macros? I have a template that is used for a
few thousand documents, and I'd like a recent change I've made to one of the
macros to be retroactivally applied to existing documents created from the
template. It would be great to kick off a tool or script to do this & let it
run overnight (or over the weekend!).

TIA,

--Doug
Shauna Kelly - 16 Dec 2006 02:02 GMT
Hi Doug

There's some code at the following page that attaches a new template to
documents: http://support.microsoft.com/kb/830561. It's not trivial, and not
for the feint-hearted.

However, that code won't update all the styles from the newly-attached
template to the document. You could modify the code to do something like the
code at
http://groups.google.com.au/group/microsoft.public.word.vba.general/browse_frm/t
hread/cc6eca6902554e07/
.

However, bear in mind all the caveats at the following:
How to safely update a document's styles from its template without using the
Organizer (and how to make the Tools + Templates and Add-ins dialog safe)
http://www.word.mvps.org/FAQs/MacrosVBA/UpdateStyles.htm

In particular, bulleted and numbered styles generally don't copy properly
and/or are applied inappropriately to the text in the document.

Finally, none of this will copy macros. In the normal course of events, one
does not (and should not) store macros in documents. The following may help
explain:
What is the relationship between a Word document and its template?
http://www.ShaunaKelly.com/word/templaterelations/index.html

and, see
What happens when I attach a new template to my document? or How do I copy
content and settings from a template to a document?"
http://www.ShaunaKelly.com/word/attachtemplate/index.html

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Does anyone know of a tool that can search for documents that have a
> particular template attached and automatically attach a new template, in
[quoted text clipped - 7 lines]
>
> --Doug
Doug - 18 Dec 2006 19:11 GMT
Thanks for the reply Shauna...in re-reading my post, I stated the problem
incorrectly. The macros are fine. The problem is that we are reconfiguring
our servers and moving the templates to another server location. The new
server will have a different URL than the old server. Any suggestions on how
to handle this kind of migration? I'm concerned that when users open
existing documents, the URL will be broken and the templates won't be found
and therefore the macros won't run.

Thanks again...

--Doug

> Hi Doug
>
[quoted text clipped - 43 lines]
>>
>> --Doug
Malcolm Smith - 18 Dec 2006 23:48 GMT
Doug

I believe that you are doing this the wrong way around.  It would be
easier if the templates were on the local machine and each time that a
user logs on a script fires which sends down the templates to the user's
machine.

This way if the network is dead then the templates still work.  

And if the servers move then the central script (on the servers) is
modified and that works for everyone.

- Malc

> *From:* "Doug" <dougATloweNOSPAMwriterDOTyou-know-what>
> *Date:* Mon, 18 Dec 2006 11:11:40 -0800
[quoted text clipped - 64 lines]
> >>
> >> --Doug
Shauna Kelly - 20 Dec 2006 11:25 GMT
Hi Doug

The first link I gave is expressly about your circumstance.

And for what it's worth, I agree with Malcolm - the best solution is to put
the templates on the local machine and have a script to run at log-in that
copies the latest version down to the machine.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Thanks for the reply Shauna...in re-reading my post, I stated the problem
> incorrectly. The macros are fine. The problem is that we are reconfiguring
[quoted text clipped - 55 lines]
>>>
>>> --Doug

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.