Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Automation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word Automation
Divers
Thread ID:
00491895
Message ID:
00491895
Vues:
43
I have a VFP6 application that uses automation with Word 97 and above. It allows the users to do "one-off" mail merges with the current record they are on. Word is left open and visible so they can make edits to the resulting document, print, fax, etc. I use GetObject() to re-use the current instance of Word (if one exists) because I can't trust the users won't keep firing off new Word instances and leaving them open. The problem I am having is that now they have this other document (not sure what it is) that they leave open to look stuff up. What's been happening is that they will leave the Find dialog open and this causes and error 1429 and my error handler just shuts the app down.

Here is the error: OLE IDispatch exception code 0 from Microsoft Word: The Open method or property is not available because the Find or Replace dialog box is open...

My question is, does anyone know how to iterate through the dialogs collection and close any open dialogs? (I'm assuming any other dialog would cause a problem, too) Or, is there a way to tell if any dialog is active and close it (without having to iterate through all dialog types)?

Or, any other suggestions on how to handle these situations? (Other than telling them to remember to never leave a dialog open, as I know that will not will not fly with these users)

Thanks in advance,
Randy
Randy Jean
Orion Group Software Engineers
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform