Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mail Merge fields from an active document
Message
From
11/07/2005 14:02:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Mail Merge fields from an active document
Miscellaneous
Thread ID:
01031326
Message ID:
01031326
Views:
59
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
Map
View

Click here to load this message in the networking platform