Existing template just has the header and footer, wtih graphics for each. I want to throw the Excel data on a blank copy of the template, but not on the template itself so that I don't overlay the original. I want my excel data to save as a word document that has the same background header and footer as the template. Daniel's code below does what I want except that it creates a brand new word document without the header and footer graphics that are sitting in my other word template. If I could just change to the code below the third line instead of it being Set WdObj = CreateObject("Word.Application") make it something like Set WdObj = CreateObject("Word.Application").copyfrom("C:\mytemplate") I would be set. I just don't know the syntax to do this.
Thank you so much.
Dim WdObj As Object, fname As String
fname = "Word"
Set WdObj = CreateObject("Word.Application")
WdObj.Visible = False
Range("A1:I30").Select
Selection.Copy 'Your Copy Range
WdObj.Documents.Add
WdObj.Selection.PasteSpecial Link:=False, _
DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False
Application.CutCopyMode = False
If fname <> "" Then 'make sure fname is not blank
With WdObj
.ChangeFileOpenDirectory "c:\temp" 'save Dir
.ActiveDocument.SaveAs Filename:=fname & ".doc"
End With
Else:
MsgBox ("File not saved, naming range was botched, guess again.")
End If
With WdObj
.ActiveDocument.Close
.Quit
End With
Set WdObj = Nothing