Hi,
I have a problem with the code listed below, This code appeared in the Foxpro Advisor tips February 2001, It works fine on an NT, Win 2000, or Win 98 machine. But when we try to run it on a Win 95 machine we get the error "OLE error code 0x80080005: Server execution failed. It is bombing on the createobject command.
Any Help would be appreciated.
LOCAL loWord
WAIT WINDOW NOWAIT "Spelling Check Starting..."
loWord = CREATEOBJECT("Word.Application")
* Only process if we can create a word object
IF VARTYPE(loWord) = 'O'
WITH loWord
* Add a document first.
.documents.ADD()
.VISIBLE = .F.
WITH .documents(1)
* Load the content of this into the document.
.content = THIS.VALUE
* Check the spelling
.checkspelling()
* Check the grammer
*.checkgrammer()
ENDWITH
* Only replace the content of the control with
* content of the document if they're different.
.SELECTION.WholeStory()
IF .SELECTION.TEXT # THIS.VALUE
* Checking done. Select the documents's
* complete text to populate this control.
THIS.VALUE = .SELECTION.TEXT
ELSE
WAIT WINDOW NOWAIT "Spelling Check finished" + CHR(13) + " No changes made."
ENDIF
* close the word document without saving the content.
.documents(1).CLOSE(.F.)
* Quit word
.QUIT()
ENDWITH
ELSE
* Word couldn't be started. tell the user
MESSAGEBOX("Sorry, I can't start word",48,_SCREEN.CAPTION)
RETURN .F.
ENDIF
* We're done playing now!!!!!
RETURN
Thanks