Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.AfterPrint Event (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Fires after all variables and fields print.

Syntax

expression. AfterPrint( Doc)

_expression_An expression that returns an Application object.

Parameters

NameRequired/OptionalData TypeDescription
DocRequiredDocumentThe current publication.

Remarks

Microsoft Publisher does not return UI control to the user until the event handler is executed. The event is called after all the drawing operations are completed (in other words, after the software's job finishes and the printing hardware takes over).

For more information about using events with the Application object, see Using Events with the Application Object.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to handle the AfterPrint event. It displays a message notifying the user that the document was printed.

Private Sub pubApplication_AfterPrint(ByVal Doc As Document) 
 MsgBox "Printing of " &; Doc.Name &; "is complete." 
End Sub

For this event to occur, you must place the following line of code in the General Declarations section of your module.

Private WithEvents pubApplication As Application

Then run the following initialization procedure.

Public Sub Initialize_pubApplication() 
 Set pubApplication = Publisher.Application 
End Sub

See also

Concepts

Application Object

© 2018 Microsoft