View Single Post
 
Old 09-25-2018, 07:23 PM
stevenel stevenel is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Jul 2018
Posts: 26
stevenel is on a distinguished road
Default

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
Reply With Quote