Adding spell check in DW

Hi All,
How can I add a spell check functionality in a datawindow .
I need to spell check on every text column of DW, I am using PB 10.50.

Thanks
Srikanth
shore-supportAsked:
Who is Participating?
 
shore-supportConnect With a Mentor Author Commented:
thanks Rosh ,

it is working

srikanth.
0
 
diasroshanConnect With a Mentor Commented:
Hi,

http://www.devx.com/tips/Tip/24943,

To interface to the Word spelling checker you will need to use OLE Automation to create a link to the Word application, then call the correct Word Basic functions.

The following code opens up the spelling checker dialog box for you. Note that you will need to convert any CR/LFs in PowerBuilder to CRs before calling the Word dialog box and then change the CRs back to CR/LFs after calling the module.

 
OleObject lole_Spell
Long ll_RC

SetPointer( HourGlass! )

// Word is available so replace all CR/LFs with CRs
this.ReplaceChar( as_Text, '~r~n', '~r' )

// Connect to Word and do a spell-checklole_Spell = CREATE OleObject
ll_RC = lole_Spell.ConnectToNewObject( 'Word.Application' )
IF ll_RC <> 0 THEN
      DESTROY lole_Spell
      RETURN ll_RC
END IF

lole_Spell.Application.Visible = False
lole_Spell.Application.WindowState = 2
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
lole_Spell.ActiveDocument.Close( False )
lole_Spell.Application.Quit
lole_Spell.DisconnectObject()
DESTROY lole_Spell

// Change the CRs back to CR/LFs
this.ReplaceChar( as_Text, '~r', '~r~n' )

as_Text will now contain text with the correct spelling.

Cheers,
Rosh
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.