I found the following thread on a Powerbuilder forum from back in 1999.
- Matt
<message below>
Message 1 in thread
From: eric chung (saifaic@hkstar.com)
Subject: spell check with MsWord, not Excel
Newsgroups: powersoft.public.powerbuilder.ole-ocx-activex
View this article only
Date: 1999/03/01
Hi all,
I use multiLineEdit to contain the text what I typed and I want to use
spellcheck function with MsWord to change the wrong spelling at
multiLineEdit without display word document. Is there any samples ?
thanks a lot.
Eric
Message 2 in thread
From: Ajomon Joseph (ajoseph@sorosny.org)
Subject: Re: spell check with MsWord, not Excel
Newsgroups: powersoft.public.powerbuilder.ole-ocx-activex
View this article only
Date: 1999/05/11
Try this:
Note: You must have word in your machine. If it works replay.
/*====================================================================*/
string sDoc
If gs_current_text = "" then Return
/*place the text in clipboard from current column*/
If Clipboard(gs_current_text) = "" Then RETURN
//OleObject MyOleObject
MyOleObject = CREATE OLEObject
If MyOleObject.ConnectToNewObject("word.application"

<> 0 Then Return
myoleobject.Application.Visible = False
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 Shared Variable OleObject
Destroy MyOleObject
messagebox("Information", "The spelling and grammer check is complete."
/*re-place the text in current column with text from clipboard */
gs_current_text = Clipboard()
/*====================================================================*/
eric chung wrote:
> Hi all,
> I use multiLineEdit to contain the text what I typed and I want to use
> spellcheck function with MsWord to change the wrong spelling at
> multiLineEdit without display word document. Is there any samples ?
> thanks a lot.
>
> Eric
Message 3 in thread
From: Oliver Willandsen [European Commission] (oliver.willandsen@PAS_DE_PUBsg.cec.be)
Subject: Re: spell check with MsWord, not Excel
Newsgroups: powersoft.public.powerbuilder.ole-ocx-activex
View this article only
Date: 1999/05/11
On Tue, 11 May 1999 10:10:01 -0400,
in powersoft.public.powerbuilder.ole-ocx-activex
Ajomon Joseph <ajoseph@sorosny.org> wrote:
>Try this:
>Note: You must have word in your machine. If it works replay.
>/*====================================================================*/
>string sDoc
>
>If gs_current_text = "" then Return
>
>/*place the text in clipboard from current column*/
>If Clipboard(gs_current_text) = "" Then RETURN
>
>//OleObject MyOleObject
>
>MyOleObject = CREATE OLEObject
>
>If MyOleObject.ConnectToNewObject("word.application"

<> 0 Then Return
>
>myoleobject.Application.Visible = False
>
>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 Shared Variable OleObject
>Destroy MyOleObject
>
>
>messagebox("Information", "The spelling and grammer check is complete."

>
>/*re-place the text in current column with text from clipboard */
>gs_current_text = Clipboard()
>
>/*====================================================================*/
>
>
>eric chung wrote:
>
>> Hi all,
>> I use multiLineEdit to contain the text what I typed and I want to use
>> spellcheck function with MsWord to change the wrong spelling at
>> multiLineEdit without display word document. Is there any samples ?
>> thanks a lot.
>>
>> Eric
>
Or alternatively, if you don't want to use the clipboard :
// public function boolean of_spellcheck (powerobject apo_spellcheckobject,
string as_language)
// replace 'This' with you_oleobject if you're not actually _in_ the
// oleobject !!
CHOOSE CASE apo_spellcheckobject.TypeOf( )
CASE datawindow!
ldw_sheet = apo_spellcheckobject
ls_oldtext = ldw_sheet.GetText( )
CASE multilineedit!
lmle_object = apo_spellcheckobject
ls_oldtext = lmle_object.Text
CASE singlelineedit!
lsle_object = apo_spellcheckobject
ls_oldtext = lsle_object.Text
CASE ELSE
MessageBox( "ERREUR", "This object can not be spellchecked" )
RETURN FALSE
END CHOOSE
// create a new document
This.Application.Documents.Add ()
// insert text to be spell-checked
This.Selection.InsertAfter( ls_oldtext )
//Choose Case li_countrycode
// Case 1043
// Messagebox("Taal", "Nederlands"

// Case 1036
// Messagebox("Langue", "Français"

// Case 1031
// Messagebox("Sprache", "Deutsch"

// Case 2057
// Messagebox("Language", "UK English"

// Case 1033
// Messagebox("Language", "US English"

// Case Else
// Messagebox("Language", "Unknown"

//End Choose
CHOOSE CASE as_language
CASE 'DK'
This.Selection.LanguageId( 1030 )
CASE 'NL'
This.Selection.LanguageId( 1043 )
CASE 'EN'
This.Selection.LanguageId( 2057 )
CASE 'FI'
This.Selection.LanguageId( 1035 )
CASE 'FR'
// This.Selection.LanguageId( 1036 )
CASE 'DE'
This.Selection.LanguageId( 1031 )
CASE 'GR'
This.Selection.LanguageId( 1032 )
CASE 'IT'
This.Selection.LanguageId( 1040 )
CASE 'PT'
This.Selection.LanguageId( 2070 )
CASE 'ES'
This.Selection.LanguageId( 1034 )
CASE 'SU'
This.Selection.LanguageId( 1053 )
CASE ELSE
This.Selection.LanguageId( 1036 )
END CHOOSE
// invoke the spellchecker
CHOOSE CASE as_language
CASE 'FR', 'EN'
la_spellcheck_returncode = This.ActiveDocument.CheckGrammar()
CASE ELSE
la_spellcheck_returncode = This.ActiveDocument.CheckSpelling()
END CHOOSE
If IsNull( la_spellcheck_returncode ) Then
This.ActiveDocument.Content.Select
This.Selection.MoveLeft( 1, 1, 1 )
ls_spellchecked = This.Selection.Text
// copy the spellchecked selection back to the calling object
CHOOSE CASE apo_spellcheckobject.TypeOf( )
CASE datawindow!
ldw_sheet.SetText( ls_spellchecked )
CASE multilineedit!
lmle_object.Text = ls_spellchecked
CASE singlelineedit!
lsle_object.Text = ls_spellchecked
END CHOOSE
End If
// close the active document
This.ActiveWindow.Close( 0 )
//quit Word
This.Application.Quit
// disconnect the object
This.disconnectobject( )
---
Regards
Oliver Willandsen [European Commission -
]
Remove PAS_DE_PUB from Email address