General information
Category:
COM/DCOM and OLE Automation
Title:
Mail Merge fields from an active document
HI All,
I have been trying to complete a mail merge routine using MS Word 2002. The data source will be a small text file which is created from an ever-changing field list derived from an SQL database. In order to create this text file in the most efficient manner, I need to retrieve the mail merge field names in the document used for the mail merge. This document is one a user will choose and could contain one, three, five or even fifty-five mail merge fields. This statement tells me how many mail merge fields there are in the DOC...
mmcount=document.MailMerge.Fields.Count
But, what do I use to get the name of each field? I am certain there will be a loop and counter involved... I was hoping something like ...
mmFname=document.MailMerge.Fields.item(x).Name ;
Please note that I have already dicovered the syntax to get the field names from the datasource.. this I do not want since the datasource will change dynamically. I need the mail merge field names from the active document regardless of data the source.
Any help would be GREATLY appreciated!
Thanks,
Paul
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only