Application.DocumentBeforeClose Event
Publisher Developer Reference |
Occurs immediately before any open document closes.
Syntax
expression.DocumentBeforeClose(Doc, Cancel)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Doc | Required | Document | The document that is being closed. |
Cancel | Required | Boolean | False when the event occurs. If the event procedure sets this argument to True, the document does not close when the procedure is finished. |
Remarks
To access the Application object events, declare an Application object variable in the General Declarations section of a code module. Then set the variable equal to the Application object for which you want to access events. For information about using events with the Microsoft Office Publisher Application object, see Using Events with the Application Object .
Example
This example prompts the user for a yes or no response before closing a document. To see this example work, this code must be placed in a class module and an instance of the class must be correctly initialized, using an example similar to the SetPubApp routine below.
Visual Basic for Applications |
---|
|
See Also