Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Word grammar checking, need to get grammar checking window to foreground with Visual FoxPro

Status
Not open for further replies.

wtotten

IS-IT--Management
Apr 10, 2002
181
US
thread184-1676140

I see someone got a Word window to to come to the foreground here from within a VFP application. My issue is that I am calling the Word grammar checker from my VFP application and in Windows 7 the grammar check dialog box doesn't appear on top (in the foreground). I'm not skilled with these type of Win32 calls, so does anyone have a suggestion on if, and how, I can use this to get the grammar check dialog box to the foreground? It's only a problem in Windows 7. When the application runs on XP, the dialog box comes to the foreground just fine.

Bill
 
The problem is not to bring the Word window to top, but to move it out of sight, still have oWord.visible = .t. to have all the other word dialogs (spell and grammar checker) visible at all.

Then, secondary, keep own forms "calm" by not setting them AlwaysOnTop.

Have you tried what I suggested in your other thread about the spell checker?

Bye, Olaf.
 
I'm not trying to bring Word to the top, I'm trying to bring the dialog box to the top. I did what you suggested by opening Word, making the window "normal" size and then closing it. The "window is maximized" error did not appear after I did that, but I still have the same problem wherein I have to Alt+tab to the dialog box instance to get it on top. Again, it's only on Windows 7. XP is fine.

None of my forms in this situation are AlwaysOnTop = .t. - it is set to .F.

Was I supposed to change any of the code from that "spell check with Word" thread? Or, was I only needing to do the "open Word, make window normal size, and then close Word" step?

Bill
 
No code change is needed other than making word normal size, but in my case it's Win7+Word 2010, What's your combination?
And you actually didn't answer what code of the thread you used. I used the original one in the question asked, nothing changed to use an SCX instead.

The next step might really be bringing the word windows (all of them, not only the off screen main window) to top to also bring the spell/grammar checking dialogs to top.

Bye, Olaf.
 
If anyone looking at this thread has the same problem with Windows 7, OlafDoschke posted a solution in another thread I posted. Here is the thread:

Look at the bottom where he provided the code:
* Prerequisite: goWordDoc is a Word Doc object you got from Documents.Add()
DECLARE INTEGER SetForegroundWindow IN user32 INTEGER hwnd

Local lnHwnd
lnHwnd = goWordDoc.Windows.Item(1).Hwnd
SetForegroundWindow(lnHwnd)

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top