- Raymond Longoria
- PowerBuilder
- Wednesday, 24 February 2021 12:50 AM UTC
I migrated a Powerbuilder application from 8.0 to 2019 R2. The application uses Microsoft Word Spellcheck to check the text in a RTF object. On Windows 7 computers, the spellcheck window appears and gets the focus but on Windows 10 computers the spellcheck does not appear until you click the Word icon in the taskbar.
Any suggestions on how to get the spellcheck window to get the focus automatically would be greatly appreciated. We are eventually moving away from Microsoft Word so we are open to alternative solutions.
CODE:
oWord = CREATE oleobject
lnvuo_clipboard = CREATE nvuo_clipboard
IF oWord.ConnectToNewObject("word.application") <> 0 THEN return arg_s_somertf
oWord.Visible = FALSE
oDoc = oWord.Documents.Add
oWord.WindowState = wdWindowStateMinimize
oWord.Application.ScreenUpdating = False
lnvuo_clipboard.nvuof_set(arg_l_winhandle, arg_s_somertf)
oWord.Selection.Paste
oDoc.CheckSpelling()
oDoc.Range.copy
lnvuo_clipboard.nvuof_get(arg_l_winhandle, ls_newRTF)
// Clear object memory
DESTROY lnvuo_clipboard
oDoc.saved = TRUE
oWord.Documents.Close (0) // Close file without saving
oWord.Quit() // Exit Word
DESTROY oWord
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.