existing word documents wont open because "document template" property points to a server that doesn

J

Jeremy P

I posted earier about opening a word doc and getting bad arp reuests. After
a few more hours of researching here's what I'm finding:

our existing Word documents are based on templates. If I open a Word doc,
and click TOOLS--->TEMPLATES AND ADDINS, I gte a screen that shows what
template the open document is based on.

My problem is that we have hundreds of docs that have a UNC path listed
there \\Bassett2\common\templates\faxsheet.dot for example. The problem is
that Bassett2 is no longer on our network, so whenever you try to open any
of the files based on that template, Word tries to connect to Bassett2, and
dies when it doesn't respond.

If I copy any of the files that dont work over to my local drive, then
unplug my network cable, it works fine (with networking down Word doesn't
try to talk to Bassett2). Plug back in, and down she goes... Even if the
file is stored locally.

Is there a way around this??? Is there a way to change the "document
template" property on hundreds of Word documents all at once???

Please help

Thanks
Jeremy P
 
J

Jezebel

Easy enough if you can write some VBA: open each document in the folder,
change the 'AttachedTemplate' property, save.
 
J

Jeremy P

can you give me an example code to do that???



Easy enough if you can write some VBA: open each document in the folder,
change the 'AttachedTemplate' property, save.
 
J

Jezebel

Something along these lines

Dim pDoc as Word.Document
Dim pFile as string

pFile = Dir("c:\......\*.doc") <--- whatever folder on your
machine that you've copied to the files to

Do until len(pFile) = 0

set pDoc = Documents.Open(pFile)
with pDoc
.AttachedTemplate = "MyTemplate.dot"
.Save
.Close
end with
set pDoc = nothing

pFile = Dir

Loop
 

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