VBA code to query if a built-in Word dialog is open

I have an application that manipulates a Word document.  The twist is that Word and the document are visible to the user, who is supposed to be cooperating with us :-)  A problem came up: if the user brings up a built-in Word dialog, such as Text Form Field Options, and then switches over to my app and asks it to do something to the document, I get "80010001 Call was rejected by callee".

My question: is there a way to query Word and find out whether one of its built-in dialogs is pending?  I do not see any properties in the application or the document that seem relevant.  
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joanne M. OrzechManager, Document Services CenterCommented:
I see you haven't had any response so I'm going out on a limb here.... maybe:

If Dialogs.Count <> 0 Then
    MsgBox "A Dialog box is open"
End If

Open in new window

rexswainAuthor Commented:
Oooo that looked tempting.  But I'm afraid that Dialogs.Count reports the total number of built-in dialogs (250 on my system!), not just the ones that are open.

Interestingly, Word does know about this situation.   If you have a dialog open and  then use ActiveX to send the Quit method to the application, Word puts up a dialog saying:

You cannot close Microsoft Office Word because a dialog box is open.
Click OK, switch to Word, and then close the dialog box.
Too bad they don't allow me to query that situation.
Joanne M. OrzechManager, Document Services CenterCommented:
Oh - sorry!  I was assuming again.... and you know what that does!!!  I've used that to find out if there's an ActiveDocument on the screen.... mea culpa.

I did find an article about dismissing dialog boxes.... http://support.microsoft.com/kb/259971

Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

rexswainAuthor Commented:
Thanks for the link to the MS article.  But it assumes that you (the VBA process) opened the dialog box.  In my case, it's the "cooperating" end user (cue laughter) that may have opened the dialog.  

But thanks again for your efforts.  Judging by the deafening silence, this must be a difficult problem!
Joanne M. OrzechManager, Document Services CenterCommented:
Sorry I couldn't be of more assistance.... :(
rexswainAuthor Commented:
I did not find a solution to this question, and I got tired of nagging email from EE, so I am closing it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rexswainAuthor Commented:
I have run into this problem again, so I am reopening the question in hopes of an answer...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.