Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15  
Old 09-25-2018, 07:23 PM
stevenel stevenel is offline Word MergeField Code Text issue Windows 7 64bit Word MergeField Code Text issue Office 2013
Novice
Word MergeField Code Text issue
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word MergeField Code Text issue Mail Merge Code Issue Andrewwill Mail Merge 6 01-06-2018 10:25 PM
Word MergeField Code Text issue 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
Word MergeField Code Text issue 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft