Dim WithEvents WordApp As Application
Private Sub Document_New()
Set WordApp = Application
End Sub
Private Sub Document_Open()
Set WordApp = Application
End Sub
Private Sub WordApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
'Text displayed to the user if they try to print
strMessage = "This document cannot be printed."
MsgBox strMessage, vbOKOnly + vbExclamation, "Print"
Cancel = True
End Sub
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)