Words Spell Checker not working  
Author Message
Spangltk





PostPosted: Visual FoxPro General, Words Spell Checker not working Top

I have a spell checker button in a form that uses microsoft word, here's my code:

oWord=CREATEOBJECT("Word.Application")
oWord.WindowState=2
_CLIPTEXT= bookstore.frmdesc
oWord.Documents.Add.Content.Paste
oWord.ActiveDocument.CheckSpelling()
oWord.Visible=.F.
=oWord.ActiveDocument.Select
cText=oWord.Selection.Text
cText=LEFT(cText,LEN(cText)-1)
REPLACE bookstore.frmdesc WITH cText
_CLIPTEXT=""
oWord.Documents.Close(0)
oWord.Quit(0)
thisform.Refresh

bookstore.frmdesc is a character field in a table, it's the text field in the form thats being spellchecked.

my problem is that when the spell checker window pops up, it will highlight mispelt words but it won't show any of the suggestions. I've had other problems but they pertained to my Word program and not this code, is this problem with my code or with other software Also, i grabbed this code off the net somewhere, are there any good resources for actually learning what I'm doing


Visual FoxPro1  
 
 
Alex Feldstein





PostPosted: Visual FoxPro General, Words Spell Checker not working Top

That code sample should work. You got it from John Koziol's example in the fox Wiki:

http://fox.wikis.com/wc.dll Wiki~AutomationExamples

It requires MS Word to be installed.

 

To learn more about MS Office Automation I would recommend:

"Microsoft Office Automation with Visual FoxPro" by Tamar Granor and Della Martin

http://www.hentzenwerke.com/catalog/autofox.htm

 

For an alternative, look at this sample by Craig S. Boyd:

http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,8800bdb9-a9c2-484f-942f-6a08947d903a.aspx

 


 
 
Spangltk





PostPosted: Visual FoxPro General, Words Spell Checker not working Top

great, thanks for the resources