Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation
Message
From
26/11/2000 10:17:34
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Word Automation
Miscellaneous
Thread ID:
00445480
Message ID:
00445480
Views:
48
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...
Next
Reply
Map
View

Click here to load this message in the networking platform