Hi Everyone,
I have recently performed a server upgrade at a clients site where we consolidated file servers and installed terminal services. We havn't got the smae file server anmes or shares any more. when the users open word documents that were greated from server based templateds that existed on servers that are no longer present it takes ages to try and find the template before opening the document. I have found a script(pasted below) in the microsoft article at this address
I need to know if i can turn this into a vbscript and also if i can make it do a couple of extra things. The script is designed to run thru all documents in one folder and change the server template path from the old to the new. I need to enhance this to allow for searching on 4 or 5 different existing template paths plus ideally i want to be able to set it off on one network drive and for it to go through all the files/folders doing every single one.
Any help would be most appreciated, i think i may be able to work the bit of cycling through subfolders out but i's still going to need help.
Thanks in advance for any advice.
Skr
I have recently performed a server upgrade at a clients site where we consolidated file servers and installed terminal services. We havn't got the smae file server anmes or shares any more. when the users open word documents that were greated from server based templateds that existed on servers that are no longer present it takes ages to try and find the template before opening the document. I have found a script(pasted below) in the microsoft article at this address
I need to know if i can turn this into a vbscript and also if i can make it do a couple of extra things. The script is designed to run thru all documents in one folder and change the server template path from the old to the new. I need to enhance this to allow for searching on 4 or 5 different existing template paths plus ideally i want to be able to set it off on one network drive and for it to go through all the files/folders doing every single one.
Any help would be most appreciated, i think i may be able to work the bit of cycling through subfolders out but i's still going to need help.
Thanks in advance for any advice.
Skr
Code:
Sub Test()
Dim strFilePath As String
Dim strPath As String
Dim intCounter As Integer
Dim strFileName As String
Dim OldServer As String
Dim NewServer As String
Dim objDoc As Document
Dim objTemplate As Template
Dim dlgTemplate As Dialog
OldServer = "<\\rsnj01\vol1>"
NewServer = "<\\rsnyc1p\vol3>"
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, 13)) = LCase(OldServer) Then
objDoc.AttachedTemplate = NewServer & Mid(strPath, 14)
End If
strFileName = Dir()
objDoc.Save
objDoc.Close
Loop
Set objDoc = Nothing
Set objTemplate = Nothing
Set dlgTemplate = Nothing
End Sub