Execute VBA before printing
Hello.
I'm trying to open a messagebox prompting a yes/no question when someone presses the print-icon in Word 2013.
This is the code I've written:
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)Dim Result As Long
Result = MsgBox("Text", vbYesNo)
If Result = vbNo Then
Exit Sub
Else
ActiveDocument.PrintOut
End If
End Sub
Sub FilePrintDefault()
Dim Result As Long
Result = MsgBox("Text", vbYesNo)
If Result = vbNo Then
Exit Sub
Else
ActiveDocument.PrintOut
End If
End Sub
However, I can't get the code to fire. Some input on how to get the code to fire would be much appreciated.
Thanks
|