Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement