Click to See Complete Forum and Search --> : VB OLE Automation


July 22nd, 1999, 02:34 PM
Anyone know how to close an instance of Word from within VB? I am already setting my object variable to nothing but with no success.

July 22nd, 1999, 03:12 PM
I have used the following code to Close the Document and Quit Word.
fobj_Word is my Word Application. fobj_Doc is my Document



set fobj_Word = CreateObject("Word.Application")

set fobj_Doc = .Documents.Open(<filename>)

'Update fobj_Doc

fobj_Doc.Close wdDoNotSaveChanges 'you can use other constants
fobj_Word.Quit wdDoNotSaveChanges

July 22nd, 1999, 03:45 PM
Just found Quit method on my own, but thanks for the reply !!!