Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Spelling checking in powerbuilder

Hi Everyone,

I am using PB11.1 build 8123. I want to add a functionality to checking the spelling. I write below code but I have a problem that MS WORD open as minimized state.  I want this at front of user. Please suggest.

string ls_current_text

ls_current_text=mle_1.text

If ls_current_text = "" then Return

If Clipboard(ls_current_text) = ""  Then RETURN

OleObject myOleObject

myOleObject = CREATE OLEObject

If myOleObject.ConnectToNewObject("word.application") <> 0 Then Return

myoleobject.Application.Visible = True

myoleobject.Application.WindowState = 2

myoleobject.Application.Documents.Add.Content.Paste

myoleobject.Application.ActiveDocument.CheckSpelling

myoleobject.Application.ActiveDocument.Content.Copy

myoleobject.ActiveDocument.Close(0)

myoleobject.Application.Quit

myOleObject.disconnectobject()

Destroy myOleObject

messagebox("Information", "The spelling and grammer check is complete.")

mle_1.text=Clipboard(ls_current_text)

Tags:
Not what you were looking for? View more on this topic or Ask a question