How to automatically close document after printing

S

Sandro

I would like to know if there is a way to automatically close
a word document after it has been printed.
I tried it with recording a macro but that stangely enough
doesn't seem to work. Anyone has ny ideas on how to do this?

Thanks in advance.
 
H

Helmut Weber

Hi Sandro,

something along these lines, maybe:

Sub MyPrint()
Dim oDlg As Dialog
Set oDlg = Dialogs(wdDialogFilePrint)
If oDlg.Show = -1 Then
ActiveDocument.Save
ActiveDocument.Close
End If
End Sub
 

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