devxlogo

Third-Party Spell Checker

Third-Party Spell Checker

Question:
I’m looking for a third-party library that does spell check and has some grammar rules.

Answer:
You have two solutions to this problem. One: you can purchase a third-party control and integrate it into your application. A good example that works with PowerBuilder is Visual Speller from Visual Components (a Sybase company).

A second solution if you have a word processor that support OLE automation installed in your user base is to use the built-in spelling checker for the application. Word is a good example, and the spell checker can easily be integrated into PowerBuilder. The following block of code is an example:

This is a function that accepts a string by reference and return an integer return code:

OleObject lole_SpellLong ll_RCSetPointer( HourGlass! )// Connect to word and do spell checklole_Spell = CREATE OleObjectll_RC = lole_Spell.ConnectToNewObject( 'Word.Application' )IF ll_RC <> 0 THEN	DESTROY lole_Spell	RETURN ll_RCEND IFlole_Spell.Application.Visible = Falselole_Spell.Application.WindowState = 2lole_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.Textlole_Spell.ActiveDocument.Close( False )lole_Spell.Application.Quitlole_Spell.DisconnectObject()DESTROY lole_SpellRETURN 1
See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist