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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to Bring to Top SpellCheck Window that is open via Word OleObject

Status
Not open for further replies.

cedxjlj

Programmer
Mar 21, 2011
1
US
I have a classic PB 12.1 application that opens the Word Spell Checker using an OLE object. In XP using Word 2007 the spell check window is the top window; i.e. it is displayed on top of the application window. This is good since the user can see it!
On a Windows 7 machine using Word 2010 the spell check window is underneath the PB application window; the user cannot see it. Any ideas on what I can do to get the spell check window on top?
Here's the relevant code:

lole_Spell.Application.Visible = TRUE
lole_Spell.Application.WindowState = 2 // don't want user to see Word window
w_pso_request_frame.BringToTop = FALSE

// the above works if I have no other applications open.
// But if another app is open that is the window the user sees.
// So somehow I need to bring the SpellCheck window to the top.

lole_Spell.Documents.Add()
lole_Spell.Selection.TypeText( as_Text )
lole_Spell.Selection.HomeKey()
lole_Spell.Selection.MoveStart()
lole_Spell.ActiveDocument.CheckSpelling()
lole_Spell.ActiveDocument.Select()
as_Text = lole_Spell.Selection.Text
......etc

Any ideas much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top