Modifying the template-name for many documents

G

Graphe Neester

Hi,
After shutting down a server we needed to move the company templates to
another server.
For new docs this works ok with Group Policy to modify everyones settings
for "File Locations - Workgroup templates".

But: We have hundreds of old documents that are causing massive trouble. The
reason is under "Tools - TemplatesAndAdd-ins" where the document template is
pointing to the UNC-path of the old server.
Every time someone opens such a document in word XP, it takes about 5-10
minutes before Word is satisfied with its browsing for that template. Then
the user of course can manually modify the reference to the new location so
that next time the doc is opened everything is OK.

I would die trying to modify so many docs manually....
So: Does anyone out there have some tips or maybe code for VB or VBA to
modify one or many documents programmatically ?

I found a tip on
http://wordtips.vitalnews.com/Pages/T1101_Batch_Template_Changes.html
but so far I'm having trouble getting that to work.


Hopefully,
Arild
 
G

Graphe Neester

Thanks a lot for a comprehensive article on that subject. I've done some
testing and seems to be getting at least somewhere. I will contact Microsoft
to obtain that "non-public" patch they talk of (to get rid of the FileOpen
delay).

I made a modified VBA-code from "Method 3", since I need to change both
server and path (from \\serverX\Office\Template\em.dot to
W:\Template\em.dot)
This works OK, meaning I'm able to change the "Attached Template" setting in
"Tools" - "Templates and Add-ins" as desired. The issue now is that this
code needs to open the document to make the change. That is unfortunat in 2
ways:
- It takes 5-10 minutes due to the basic issue in KB830561 (probably fixed
with patch in KB823372)
- The file date changes.

In the article
http://wordtips.vitalnews.com/Pages/T1101_Batch_Template_Changes.html
there is a use of DsOleFile, with a comment that this does not alter file
date. But that didn't work on my PC.

So I'm pushing carefully ahead asking: Do you (or anyone) know any
possibility to change that "Attached template"-path from outside, without
changing the file date....?
 
S

Shauna Kelly

Hi Graphe

I suggest you get the patch from Microsoft and see how much of your problems
it addresses. Then post back here to see what else might need to be done.

Hope this helps.

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

Howard Kaikow

I would not recommend getting the patch.
It's really not the right solution.

This problem is easily solved by using the VBA solutions provided in the KB
830561 article.
 
G

Graphe Neester

Will get the patch later today, and I agree that isolatedt, the case is
probably easy solved then.
Only thing I hate then, is that the VB.code changes filedate when it
automatically saves the documents after correction.

And my headache is another system I manage, containing a doc-library of
Wordfiles and PDF-copies. That system uses a logic to check users have an up
to date PDF-copy: "Is the PDF-fildate newer than Word-Filedate?". This logic
will of course fail.

So I'm still considering to only install the patch and maybe write a little
Word AddIn to fix the Template-path only when somebody later tries to save a
modified version.....
 
A

Arno

The patch had no value at all - since it was released for SP1 (probably Win
XP SP1). The KB article said nothing of that, but I got a message when
trying to install.
So: The patch should introduce a new Registry setting. I checked, and the
reg setting was right there. Then the KB said: Put value
ServerNotFoundCacheLifeTimeInSec=180.
It was 180. I tried changing to 60. Still it takes more than 10 minutes to
open a one-page document, just because the references template isnt
there....

And the problem with the VBA code is that it needs to open each doc, and
even by code that also takes 10 minutes pr doc.

Anyone has a rescue tip now ? ?
 
H

Howard Kaikow

Arno said:
The patch had no value at all - since it was released for SP1 (probably Win
XP SP1). The KB article said nothing of that, but I got a message when
trying to install.
So: The patch should introduce a new Registry setting. I checked, and the
reg setting was right there. Then the KB said: Put value
ServerNotFoundCacheLifeTimeInSec=180.
It was 180. I tried changing to 60. Still it takes more than 10 minutes to
open a one-page document, just because the references template isnt
there....

And the problem with the VBA code is that it needs to open each doc, and
even by code that also takes 10 minutes pr doc.

Anyone has a rescue tip now ? ?

Without having all the details, I can only guess.

There may be ways to speed up the macro.
For example, use a hidden instance of Word and do not display the document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top