Invalid Path to File in Templates & Add-ins Word 2000

  • Thread starter Thread starter David
  • Start date Start date
D

David

Since retiring an old server, may user Word 2000 documents take minutes to
open rather than seconds. After poking about within the slow files, I found
a reference to the old server in Tools > Templates and Add-Ins, in the
Document template box. Deleteing the box contents and saving the file fixes
the problem; file opens nice and fast after that. But opening each and every
file to fix will take hours and hours (lots of users and files). I noticed
that after deleting the bad reference and saving, Normal appears in the box.
Is there a fast way to replace the offending reference with Normal? Is there
a way to turn off saving the template used to create new documents?
Thanks for the help!
David
 
You could run the following macro on a folder and it will apply the normal
template to all the documents in that folder. Enter the path to normal.dot
in the relevant place near the end of the macro to reflect your own
installation:

Sub ApplyNormalTemplate()
Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document

With Dialogs(wdDialogCopyFile)
If .Display <> 0 Then
PathToUse = .Directory
Else
MsgBox "Cancelled by User"
Exit Sub
End If
End With

If Documents.Count > 0 Then
Documents.Close Savechanges:=wdPromptToSaveChanges
End If

If Left(PathToUse, 1) = Chr(34) Then
PathToUse = Mid(PathToUse, 2, Len(PathToUse) - 2)
End If

myFile = Dir$(PathToUse & "*.doc")

While myFile <> ""
Set myDoc = Documents.Open(PathToUse & myFile)
ActiveDocument.AttachedTemplate = "D:\Word Templates\normal.dot"

myDoc.Close Savechanges:=wdSaveChanges
myFile = Dir$()
Wend
End Sub

See http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
There is no way to turn off the saving of the template used to create a new
document. In some cases I have an AutoNew macro in my templates that
switches the attached template to normal.dot (to avoid this problem, among
others).

If you are up to programming, you can write a program that cycles through
all documents in a folder and switches their attached template to
normal.dot. There is an example of a program that goes through all files in
a folder in the vba FAQ on the MVP FAQ site. It is used to find and replace
but you can change the code. If you need help with this, ask in the
vba.beginners newsgroup.
--

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.
 
Thank you so much!

Graham Mayor said:
You could run the following macro on a folder and it will apply the normal
template to all the documents in that folder. Enter the path to normal.dot
in the relevant place near the end of the macro to reflect your own
installation:

Sub ApplyNormalTemplate()
Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document

With Dialogs(wdDialogCopyFile)
If .Display <> 0 Then
PathToUse = .Directory
Else
MsgBox "Cancelled by User"
Exit Sub
End If
End With

If Documents.Count > 0 Then
Documents.Close Savechanges:=wdPromptToSaveChanges
End If

If Left(PathToUse, 1) = Chr(34) Then
PathToUse = Mid(PathToUse, 2, Len(PathToUse) - 2)
End If

myFile = Dir$(PathToUse & "*.doc")

While myFile <> ""
Set myDoc = Documents.Open(PathToUse & myFile)
ActiveDocument.AttachedTemplate = "D:\Word Templates\normal.dot"

myDoc.Close Savechanges:=wdSaveChanges
myFile = Dir$()
Wend
End Sub

See http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thanks for your help!

Charles Kenyon said:
There is no way to turn off the saving of the template used to create a
new
document. In some cases I have an AutoNew macro in my templates that
switches the attached template to normal.dot (to avoid this problem, among
others).

If you are up to programming, you can write a program that cycles through
all documents in a folder and switches their attached template to
normal.dot. There is an example of a program that goes through all files
in
a folder in the vba FAQ on the MVP FAQ site. It is used to find and
replace
but you can change the code. If you need help with this, ask in the
vba.beginners newsgroup.
--

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.
 

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

Back
Top