G
GeorgeMar
I have a procedure that cycles through a list of Word
documents and prints them one at a time to the printer.
It works but the WINWORD.EXE remains open when viewed in
the Task Manager.
Here is the part of the procedure that is not working.
If Len(Dir(strFilename)) > 0 Then
Dim docWord As Object
Dim appWord As Object
Set appWord = CreateObject("Word.Application")
Set docWord = appWord.Documents.Open(strFilename)
docWord.PrintOut
docWord.Close
Set appWord = Nothing
End If
I thought that Set appWord=Nothing would close WINWORD.EXE.
Anything else I should do?
Perhaps I should also run the loop of Word documents
inside the opening and closing of appWord rather than
opening and closing the Word Application for each document.
Many thanks
George
documents and prints them one at a time to the printer.
It works but the WINWORD.EXE remains open when viewed in
the Task Manager.
Here is the part of the procedure that is not working.
If Len(Dir(strFilename)) > 0 Then
Dim docWord As Object
Dim appWord As Object
Set appWord = CreateObject("Word.Application")
Set docWord = appWord.Documents.Open(strFilename)
docWord.PrintOut
docWord.Close
Set appWord = Nothing
End If
I thought that Set appWord=Nothing would close WINWORD.EXE.
Anything else I should do?
Perhaps I should also run the loop of Word documents
inside the opening and closing of appWord rather than
opening and closing the Word Application for each document.
Many thanks
George