Link to home
Start Free TrialLog in
Avatar of Norma Posy
Norma PosyFlag for United States of America

asked on

vbModal

My VB6 program invokes the spell checker from Microsoft Office.

When running on XP the dialog box tossed up by the spell checker upon finding a spelling error appears in front of the VB6 calling form. When running on Win7, the dialog box comes up behind the calling form.

Since this dialog box is not called from a VB6 “form.show”, but called from Office’s spell checker, I can’t use vbModal.

I’ve temporarily worked around this by minimizing the calling VB6 form, then maximizing it after the spelling fix. But from the user’s point of view, it would be more intuitive if the calling form (holding the text box being spell checked) remained visible. Even if behind the spell check dialog box.

“vbModal” puts a form up front. Is there an “inverse” to vbModal to keep the calling form on screen, but behind the dialog box?
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Are you by any chance using the code from my Spellcheck a Textbox article? If not then you might try it and see if the results are different.
I doubt that you will be able to do it exactly the way you want. Generally people hide Word completely and just pass text to it to check
Avatar of Norma Posy

ASKER

Martin: Yes. It is your code. Works great.

But in XP the dialog box tossed up by Word's spell checker is in front of the VB6 form that invoked it. In Win7 the dialog box comes up behind. Haven't tried it in Win10.

Maybe there is nothing I can do about this, aside from minimizing the calling form, then restoring it. I was just wondering if there is a "reverse vbModal" to keep the calling form behind the spell checker's dialog box.
You may be able to find code that via APIs would find the Word form and make it "topmost".
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Martin: Your "Project1" test:
Puts the dialog box tossed up by Word in front when running under XP.
Doesn't when running under Win7.

By the way, Word itself never shows under both OSs. Which is good.

I can live with the situation, even though it may annoy the user. He clicks "Spell Check", then he has to Click the dialog box to get it up front where he can see it. Fortunately it pokes out the right hand side of the calling form. If it were entirely behind, that would not be usable.

I guess we can lay this on how Win7 operates differently from XP. Haven't tried all this in Win10 yet.

If there is no further input from the community here, I will close this question. Give it another day or so.
I assume the "Project1" you are referring to is from my Spellcheck.zip that I posted on 12/30. If so, try compiling the app and see if running the resulting exe behaves differently.
That's what I did. I can't run VB6 in Win7. But the compiled exe can.
You seem to be saying that you can run an exe made from my new code. If so does that fix your problem?
I compiled your code. Running the exe under XP,  the dialog box tossed up by Word's spell checker appears in front of the applications window. Running the exe under Win7, it still is behind the applications window.
OK then I'm sorry but since I can't duplicate your environment I can't do anything else for you. If you do find a coding solution please to me a favor and let me know so that I can update my article.
We did the best we could. I thank you for everything.
- - Norma