-
Printing a Word Document
Hi,
I am trying to print a Word Document and kill the word instance. The word instance is killed, but the document is never printed. Does anyone have a solution to this problem?
Thanks,
Bob
Code:
Dim objWord As New Word.Application
Dim objDoc As Word.Document
objDoc = objWord.Documents.Add(strFileName)
objWord.Documents(0).PrintOut()
objWord.Quit(Word.WdSaveOptions.wdDoNotSaveChanges)
objDoc = Nothing
objWord = Nothing
-
I'm not sure when doing this from .NET, but when I've had Word macros, I had to use ActiveDocument.PrintOut (False) to prevent Word from continuing the macro while the print job was going on. Otherwise, I got the same results you describe.