Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP Needed, Word mail merge breaks when saved as.. from an Excel Macro
I need some help, I have an excel Macro that opens a word File. This
Word file has some Merged Fields, when I save it with a different name all the merged fields brake. Is there a way of updating the word File. I paste the code downwards if you can suggest any improvement. Thanks ------------------------------------------------------------------- Sub wordchage() Dim WordApp As Object Set WordApp = CreateObject("Word.Application") fpath = ThisWorkbook.Path Doc = fpath & "\" & ("Base booklet.doc") Sheets("Incumbent").Select LetterTemplate = Doc fname = Range("A3") fnamedoc = fname & ".doc" With WordApp ..Documents.Open LetterTemplate ..Visible = False End With Application.DisplayAlerts = True WordApp.ActiveDocument.SaveAs Filename:=fpath & "\" & fnamedoc WordApp.PrintOut Background:=False ' Prints in PDF - named argument Filename:= not working WordApp.NormalTemplate.Saved = True WordApp.ActiveDocument.Close Set WordApp = Nothing Set Doc = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
merge two excel files like in word mail merge | Excel Discussion (Misc queries) | |||
Excel to Word Mail Merge | Excel Discussion (Misc queries) | |||
Mail Merge with Excel and Word | Excel Discussion (Misc queries) | |||
Merge mail excel to word | Excel Discussion (Misc queries) | |||
Excel macro to open word mail merge | Excel Programming |