PLEASE HELP ! Macro

P

Preet

Any help would be most appreciated!


How would I say in a macro

"IF the user clicks on FilePrint or on Print, THEN close the document
without any changes"

also

"IF the user clicks on Exit, THEN close the document without any
changes"

But the code below - Automatically brings the dialogue box up - I want
the user to go to the dialogue box if they want:

With Dialogs(wdDialogFilePrint)
If .Display = -1 Then
ActiveDocument.Close wdDoNotSaveChanges, wdOriginalDocumentFormat,
False
..Execute
End If
End With
 
P

Preet

Hi Shauna

Thank you for your response.

If I use the following:

Sub AutoClose ()

If Application.Dialogs(wdDialogFilePrint) Then
ActiveDocument.Close wdDoNotSaveChanges, wdOriginalDocumentFormat
False
End If

End Sub


This should Close on Printing of the word document, (but the documen
will print first)

I am new to VB, so if this is completely wrong, apologies in advance!

Thank you and hope to hear from you soon.

Pree
 

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