Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word OLE and Powerbuilder 8 1

Status
Not open for further replies.

Hurricane766

IS-IT--Management
Nov 30, 2004
34
CA
Hi,

I'm trying to use MS Word's spellchecker to spell check some text written in my program.

Code:
OLEObject myoleobject
myoleobject = CREATE 

OLEObjectmyoleobject.application.Documents.Add()
myoleobject.application.Selection.Range.Text = st_curword

myoleobject.application.Selection.Range.CheckSpelling()
//at this point the Word spell checking window pops up with suggestions for mistakes ect.

myoleobject.application.DisplayAlerts = FALSE
myoleobject.application.Quit()

That's nice and all, but I want the spell checking and correcting to happen in my program, not in word. In fact I want word to be invisible so the user thinks they're just using my program. I plan on writing my own spellchecking window but I need the following things:

1. A way to know if there was a spelling error.
2. A way to get the spelling suggestions for that error.

I've tried some things but these either don't work or I can't get the info from the ole functions.

Code:
myoleobject.application.Selection.Range.SpellingErrors 
//is supposed to return the spelling errors

myoleobject.application.Selection.Range.GetSpellingSuggestions(st_curword)
//is supposed to get the spelling suggestions for the st_curword

Niether of these seems to work: I'm not sure if they will or not, or if I just don't know the type of variable to use to get the info.

Any suggestions?
Thanks



 
Hi there. Do not know of a way to use the word spellcheck without having word pop up, but we are using a third party product to incorporate into our PB app. We are using TE Editor from SubSystems Inc where you drop the OLE object onto your window and can do whatever you want to the document/blob/whatever. They also have a spell check (SpellTime)that works with the editor that is doing the job for us. We did use VsSpell at one time, but have since changed to Spelltime as it was much easier to work with. Hope this helps.
 
Thanks for the post.

The reason we need to use Word's spellchecker is that there are certain dictionaries that you can integrate with Word and not much else... we do have a spellchecker now but there's no way to get it to use these proprietary dictionaries.

We came up with the solution to open the text as a Word .doc through an olecontrol. This way when the user is finished spellchecking ect, and they close the Word document, the olecontrol has some events that we can catch and load the new text into our program.

It's a work around from what I originally wanted but it does work rather well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top