Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Automation
Message
De
11/07/2007 19:14:38
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word Automation
Divers
Thread ID:
01239546
Message ID:
01239546
Vues:
68
BACKGROUND:

I have a Web Connection application where users can request print merges to be produced. Requested merges are placed in a request queue table, that is later read by a listner.

Once the listner application finds a request for a print merge it creates the data from the database and exports the fields into an excel file. The listner then opens the word template and attaches to the excel file as a datasource.

After the merge is completed on the server, a link is provided to the user to the merged word document.

THE PROBLEM:

The problem is that the documents are usually designed by my users and the user's names for the fields are often quite different from the reality in the database, imagine that! All would be fine if I were diligent about checking for those inconsistencies, but alas, I am always forgetting. Currently, if the correct merge field name is missing from the excel, the listner application bombs when the automation object trys to connect to excel as a datasource.

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.

Thanks for any pointers you might have!

Carole Shaw
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform