Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge two excel files like in word mail merge azmerritt Excel Discussion (Misc queries) 1 December 11th 16 09:23 PM
Excel to Word Mail Merge Jayesh Excel Discussion (Misc queries) 2 June 20th 09 02:05 PM
Mail Merge with Excel and Word RSJAAG Excel Discussion (Misc queries) 1 July 1st 08 04:55 PM
Merge mail excel to word T. Rebouche Excel Discussion (Misc queries) 2 February 21st 05 11:05 PM
Excel macro to open word mail merge Chad Excel Programming 0 May 30th 04 01:06 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"