Re: Closing of Word Application
From: GeorgeMar (anonymous_at_discussions.microsoft.com)
Date: 09/01/04
- Next message: Alex Dybenko: "Re: How do I use VBA to retrieve an Access DBs file properties?"
- Previous message: Van T. Dinh: "Re: Run Excel Macro from Access"
- In reply to: Van T. Dinh: "Re: Closing of Word Application"
- Next in thread: Van T. Dinh: "Re: Closing of Word Application"
- Reply: Van T. Dinh: "Re: Closing of Word Application"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 31 Aug 2004 23:20:25 -0700
Thank you Van
With regards to opening ang closing the Word Application,
is it more efficient to open the Word Application once and
cycle through printing the files or Opening and closing
the Word application for each print?
regards
george
>-----Original Message-----
>No. Set appWord = Nothing simply destroy the reference
to the Word
>application.
>
>You need
>
> appWord.Quit wdDoNotSaveChanges
>
>after you close the doc and before you set the reference
to Nothing.
>
>You should also set docWord to Nothing.
>
>--
>HTH
>Van T. Dinh
>MVP (Access)
>
>
>"GeorgeMar" <anonymous@discussions.microsoft.com> wrote
in message
>news:3ce201c48fbe$33c8c390$a601280a@phx.gbl...
>> 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
>
>
>.
>
- Next message: Alex Dybenko: "Re: How do I use VBA to retrieve an Access DBs file properties?"
- Previous message: Van T. Dinh: "Re: Run Excel Macro from Access"
- In reply to: Van T. Dinh: "Re: Closing of Word Application"
- Next in thread: Van T. Dinh: "Re: Closing of Word Application"
- Reply: Van T. Dinh: "Re: Closing of Word Application"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|