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
regards
I was able to resolve the issue by moving the code to the same window that contains the rte control instead of in a separate rte object. The spellcheck button comes up without a problem.Unfortunately there is still the quick flash of Word after closing the spellcheck window.
Thanks for your help!