Open Event

Microsoft Publisher Visual Basic

Private Sub object_Open( )

object    A variable which references an object of type Document declared with events in a class module.

Remarks

To access the Document object events, declare a Document object variable in the General Declarations section of a class module, then set the variable equal to the Document object for which you want to access events.

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

Example

This example displays a message when a publication is opened. (The procedure can be stored in the ThisDocument module of a publication.)

Private Sub Document_Open()
    MsgBox "This publication is copyrighted."
End Sub