Before Print Event Handler

The BeforePrint event enables you to take action before the document is actually sent to print. Note that the user can cancel the Print dialog, so there is no way to verify that the document actually printed. Listing 7.46 shows how you can require users to view each document in Print Preview before printing the document. This code sets the Cancel property to True because the user can print or cancel printing from within the Print Preview view.

Listing 7.46. Previewing a document before printing

Private Sub ThisWorkbook_BeforePrint(ByRef Cancel As Boolean) _ Handles Me.BeforePrint

Me.PrintPreview() Cancel = True

0 0

Post a comment