Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Spell check and Win 95
Message
 
À
30/07/2001 07:55:32
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00537115
Message ID:
00537173
Vues:
18
I have a win 95 machine and the create object command below works fine. Just a wild guess, but is Word installed on the Windows 95 machine and what version is it?


>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
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform