printing document from Word application

R

Ram Baruch

Hi,
I'm trying to open WINWORD, then open a documet in it, print the document
and then- close WINWORD.
This is a sample of what I wrote:

Dim PrintApp As Word.Application
Set PrintApp = New Word.Application
PrintApp.Visible = True

PrintApp.Documents.Open FileName:="E:\Sample.doc", ReadOnly:=True
PrintApp.ActiveDocument.PrintOut

PrintApp.Quit
Set PrintApp = Nothing



The problem is that when it tries to close the application, it still prints
the document, and then it displays a message that if Word will be closed,
all printing will be stopped.
Of course what I want is to close WORD after the printing is done and not
WHILE printing. Is there anyway to do it?
Regards,
Ram.
 
B

Beth Melton

Hi Ram,

You need to set Background printing to False:

With PrintApp
.Visible = True
.Documents.Open FileName:="E:\Sample.doc", ReadOnly:=True
.ActiveDocument.PrintOut Background:=False
.Quit
End With


--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top