![]() |
|
#15
|
|||
|
|||
|
Thank you to have revised. This is really appreciate ! I will change my code with your recommendation of course.
I come back with what I posted yesterday. With all my research on internet, there is only one clear solution. https://www.experts-exchange.com/que...ail-merge.html The solution is to create the data source file as a Word document instead of as a text file. The code block above save the data source file as a Word document. You then do the MailMerge specifying the Word document file as the data source (instead of a text file). Could you please help me to introduce it in my current code. Code:
Dim dsDoc As Object
Set dsDoc = wwApp.Documents.Add
With dsDoc
.Content.InsertAfter Text:=<merge field names text> & vbCr
.Content.InsertAfter Text:=<merge field data text> ' no trailing vbCR
.SaveAs sMergeFile
.Close SaveChanges:=wdDoNotSaveChanges
End With
Set dsDoc = Nothing
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge Code Issue
|
Andrewwill | Mail Merge | 6 | 01-06-2018 10:25 PM |
How to link Excel fields with MergeField in Word?
|
Fabulist | Mail Merge | 3 | 02-03-2016 02:32 PM |
| creating a code to create dynamic text in word | ah8471 | Word VBA | 1 | 12-29-2015 10:52 PM |
Printing selected pages based on a MERGEFIELD.g. If MERGEFIELD=x then print pages 1,2,4 if MERGEFIEL
|
Richard.p | Word | 3 | 04-21-2015 01:14 AM |
| Omit mergefield if it contains specific text | MikeStewart | Mail Merge | 3 | 10-01-2014 01:31 AM |