Information générale
Catégorie:
COM/DCOM et OLE Automation
I have noticed that when I use the Word spell checker I need to shut it down differently than when I create a document in Word. To make sure I get rid of the winword in the task manager I do the following.
* Spell checking
oWord = CreateObject("Word.Application")
IF oWord.CheckSpelling(oedtQuote.Value) = .F.
WITH oWord
.Documents.add
.Selection.TypeText(oedtNotes.Value)
.Visible = .T.
.WindowState = 0
.Options.CheckGrammarWithSpelling = nchkGrammar
.Options.IgnoreUpperCase = nchkIgnoreCase
.Options.IgnoreMixedDigits = nchkIgnoreNumber
.Options.IgnoreInternetAndFileAddresses = nchkIgnoreInternet
.CustomDictionaries.ActiveCustomDictionary = ;
.CustomDictionaries(ThisForm.PageFrame1.Page5.lstDictionaries.ListItemID)
IF nchkGrammar
.Activedocument.CheckGrammar
ELSE
.Activedocument.CheckSpelling
ENDIF
.Selection.WholeStory
oedtNotes.Value = .Selection.Text
.ActiveDocument.Close(0)
.Visible = .F.
ENDWITH
ENDIF
oWord.Quit()
oWord = .NULL.
RELEASE oWord
* create a document on a word template
oWord = CreateObject("Word.Application")
oDoc = .Documents.Open(lcTemplate)
... Do some stuff
oWord.Visible = .T.
oWord.WindowState = 0
oDoc = .NULL.
RELEASE oDoc
oWord = .NULL.
RELEASE oWord
If I do a oWord.Quit() in the second example I get an ole error. No biggie just thought I'd pass this along...
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement