Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AttachedTemplate Attribute slowing down file opening

Status
Not open for further replies.

VinnyPs

Technical User
Jul 12, 2005
10
0
0
CA
I have changed a server's name on the network. Since then Word documents take from 1 to 2 minutes to open for everybody in the office. I have discovered that the problem was the "document template in the Templates and Add-ins", the AttachedTemplate pointing to the old server name.

Do you have any idea how can I change this attribute on all the Office files on the network? Other then opening them one by one.

Thanks a lot...
Vince

 
I would guess that someone may have come across this issue before. Have you tried looking for a script that maybe someone has created and you can edit for your situation?

--

"If to err is human, then I must be some kind of human!" -Me
 
I have found this script:
but I would have to start it in every folder...
I would need something that goes through the network...


----------------------------------------------
Sub Test()



Dim strFilePath As String

Dim strPath As String

Dim intCounter As Integer

Dim strFileName As String

Dim OldServer As String

Dim objDoc As Document

Dim objTemplate As Template

Dim dlgTemplate As Dialog

Dim nServer As Integer



'hardcode the name of the old server.



OldServer = "{enter the name of the Old Server}"

nServer = Len(OldServer)

strFilePath = InputBox("What is the folder location that you want to use?")



If Right(strFilePath, 1) <> "\" Then strFilePath = strFilePath & "\"

strFileName = Dir(strFilePath & "*.doc")

Do While strFileName <> ""

Set objDoc = Documents.Open(strFilePath & strFileName)

Set objTemplate = objDoc.AttachedTemplate

Set dlgTemplate = Dialogs(wdDialogToolsTemplates)

strPath = dlgTemplate.Template



If LCase(Left(strPath, nServer)) = LCase(OldServer) Then

objDoc.AttachedTemplate = NormalTemplate

End If



strFileName = Dir()

objDoc.Save

objDoc.Close

Loop



Set objDoc = Nothing

Set objTemplate = Nothing

Set dlgTemplate = Nothing



End Sub
----------------------------------------------
 
Hmmm, what about creating a loop to looop through all the network attached PCs? Wouldn't it be possible to put this code within a loop like that? Surely there is some attribute of the names of the attached PCs which would allow you to loop through them all..

--

"If to err is human, then I must be some kind of human!" -Me
 
Use the redirect command on the server to point from the old name to the new location.


Regards: tf1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top