Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Templates
Is it possible to apply a Word template to multiple files at once without
having to open each file separately? -- Francois |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Templates
AFAIK you have to open the files. You could put them in a batch
folder and process the folder with a macro: Public Sub BatchAttachTemplate() Dim myFile As String Dim PathToUse As String Dim myDoc As Document 'Close any open documents If Documents.Count 0 Then Documents.Close SaveChanges:=wdPromptToSaveChanges End If 'Get the folder containing the files MsgBox "When the Copy dialog box appears drill down to the applicable folder and click on Open.", , "User Instructions" With Dialogs(wdDialogCopyFile) If .Display 0 Then PathToUse = .Directory Else MsgBox "Cancelled by User" Exit Sub End If End With If Left(PathToUse, 1) = Chr(34) Then PathToUse = Mid(PathToUse, 2, Len(PathToUse) - 2) End If 'Set the directory and type of file to batch process myFile = Dir$(PathToUse & "*.doc") While myFile "" 'Open document Set myDoc = Documents.Open(PathToUse & myFile) 'Ensure Word will sense change and resave myDoc.Saved = False With myDoc .AttachedTemplate = "Test.dot" 'Change to reflect your template name End With myDoc.Close SaveChanges:=wdSaveChanges 'Process next file in folder myFile = Dir$() Wend End Sub On Apr 20, 12:42 pm, Francois wrote: Is it possible to apply a Word template to multiple files at once without having to open each file separately? -- Francois |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
My templates open as templates and not docs, how can I change? | Microsoft Word Help | |||
Flash 8 Templates... Looking for better designs? Ready-Made Templates. | Microsoft Word Help | |||
Templates not opening as templates as word documents | Microsoft Word Help | |||
Mail Merge Templates from Multiple Templates Programmatically | Mailmerge | |||
templates based on other templates | Microsoft Word Help |