#1   Report Post  
Posted to microsoft.public.word.docmanagement
Francois Francois is offline
external usenet poster
 
Posts: 2
Default Templates

Is it possible to apply a Word template to multiple files at once without
having to open each file separately?
--
Francois
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My templates open as templates and not docs, how can I change? Sandra Microsoft Word Help 1 April 3rd 07 04:17 PM
Flash 8 Templates... Looking for better designs? Ready-Made Templates. sherman Microsoft Word Help 0 January 11th 07 11:10 PM
Templates not opening as templates as word documents Alpha Man Microsoft Word Help 2 September 26th 06 05:36 PM
Mail Merge Templates from Multiple Templates Programmatically BP Mailmerge 1 April 7th 06 02:50 PM
templates based on other templates Jackie D Microsoft Word Help 2 July 26th 05 07:33 PM


All times are GMT +1. The time now is 05:37 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"