Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another dialog to avoid - Word 2007
Message
From
16/03/2009 17:33:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Another dialog to avoid - Word 2007
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01388551
Message ID:
01388551
Views:
130
I've found that in certain cases setting .displayalerts=0 simply isn't enough.

These cases seem to be any trouble when opening the document (even if it is OK now, but Word remembers there was trouble with it last time), and when there were traces of less than successful merge (values for some fields seem to have been missing when the document was mailmerged).

I'm opening all the documents read-only; this is an invisible operation which is supposed to run unattended. I don't want any dialogs. If there's an error, log and go on, don't wait. This is supposed to work like on a computer, no waiting for dad to come and answer a "do I want to pee or not" question.

So... how do I tell it to just ignore? Because as it is now, it shows two behaviors, both very nasty:

1) case of "had trouble opening the document" - it wants to show a dialog, one of those cinemascopes with OK/help buttons below a bar, and a very wide text with Show (details) button on the left. I managed to see the dialog when I ran with oWord.visible=.t.; with Word invisible it just hung indefinitely and waited for the invisible dialog to receive a click. Had to kill the poor zombie several times.

2) case of "fields bad" - it would come visible and show the dialog. Equally bad if there's nobody to click the buttons. Maybe there'd be someone next week to take a look and maybe would click the OK and would continue... but why would Word bother if I said to open readonly...

I've found oWord.Documents.OpenNoRepairDialog(), which is to funny even for M$ (I imagine it would have a dialog with a huge list of things I may want to not repair and a checkbox for each), so I'll try that. But meanwhile, if this rings a bell in the shape of a solution (because I don't yet know whether this method with such an imaginative name will work, and whether it exists in Word 2003), chime in here. I've already marked three stars on the sky, and will run these clouds away to get them if need be.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Next
Reply
Map
View

Click here to load this message in the networking platform