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
 
Top