Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation
Message
From
12/07/2007 08:37:19
 
 
To
11/07/2007 19:14:38
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
01239546
Message ID:
01239620
Views:
27
>WHAT I WANT: (BUT DON'T KNOW AN EASY WAY TO ACCOMPLISH)
>
>What I would like is to do a little proactive programmatic checking for consistencies between the word document and the excel data. The names of the excel fields is a piece of cake since it is coming from the database, But I am not sure what the easiest way would be to get the merge fields names from the word document.
>
>If I could figure out a way to access the word document BEFORE I attempt to merge the data to see what fields it is expecting. The template is a normal word document at the point where I want to "read" the merge fields just prior to setting the datasource. Being a normal document object, I am not expecting that I will be able to find any document object properties that will help me out, but let me know if you know of one I don't.
>
>CURRENT PLAN:
>
>I have considered reading the word document as a text string and parsing out all the merge fields, I am just trying to think if there is any easier or faster way, currently this is my projected course of action.
>

You can open the Word document with Automation and cycle through the merge fields, using the MailMergeFields collection.

A better course of action, if you can control document creation, is to set up the document with the appropriate list of fields (using a MailMerge header source), so the user can pick the fields from the list of what will actually be available.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform