Jump to content

coffeeguy

Members
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

About coffeeguy

  1. Turns out it may. My I.T. team had restored the path where the templates were. I didn't know this when I was testing. It appears that if the old template path is available you can't update the document. I am going to test this tomorrow morning. As soon as I have some results I will update. I would like to use your code, the only change I would like to is make it point to the normal.dot template instead of a specific path. Like in what I posted. Any suggestions there? By the way thank you for your reply so many people let there threads go unanswered!
  2. Your post has been very helpful. I have the following code which works for one directory: Sub PointToNormal() 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 OldServer = InputBox("What is the old path of your template?(full path to file extension)") 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") strFileName = InputBox("What is the file extension you are looking for, including the dot?") 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 Can you help me set this up to parse subfolders that are contained in the FilePath string? Any help would be much appreciated!
×
×
  • Create New...