Share via


Application Events (Word)

GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

This object has the following events:

Events

Name

Description

DocumentBeforeClose

Occurs immediately before any open document closes.

DocumentBeforePrint

Occurs before any open document is printed.

DocumentBeforeSave

Occurs before any open document is saved.

DocumentChange

Occurs when a new document is created, when an existing document is opened, or when another document is made the active document.

DocumentOpen

Occurs when a document is opened.

DocumentSync

This object or member has been deprecated, but it remains part of the object model for backward compatibility. You should not use it in new applications.

EPostageInsert

Occurs when a user inserts electronic postage into a document.

EPostageInsertEx

Occurs when a user inserts electronic postage into a document.

EPostagePropertyDialog

Occurs when a user clicks the E-postage Properties (Labels and Envelopes dialog box) button or Print Electronic Postage button.

MailMergeAfterMerge

Occurs after all records in a mail merge have merged successfully.

MailMergeAfterRecordMerge

Occurs after each record in the data source successfully merges in a mail merge.

MailMergeBeforeMerge

Occurs when a merge is executed before any records merge.

MailMergeBeforeRecordMerge

Occurs as a merge is executed for the individual records in a merge.

MailMergeDataSourceLoad

Occurs when the data source is loaded for a mail merge.

MailMergeDataSourceValidate

Occurs when a user validates mail merge recipients by clicking Validate in the Mail Merge Recipients dialog box.

MailMergeDataSourceValidate2

Occurs when a user validates mail merge recipients by clicking the Validate addresses link button in the Mail Merge Recipients dialog box.

MailMergeWizardSendToCustom

Occurs when the custom button is clicked during step six of the Mail Merge Wizard.

MailMergeWizardStateChange

Occurs when a user changes from a specified step to a specified step in the Mail Merge Wizard.

NewDocument

Occurs when a new document is created.

ProtectedViewWindowActivate

Occurs when any protected view window is activated.

ProtectedViewWindowBeforeClose

Occurs immediately before a protected view window or a document in a protected view window closes.

ProtectedViewWindowBeforeEdit

Occurs immediately before editing is enabled on the document in the specified protected view window.

ProtectedViewWindowDeactivate

Occurs when a protected view window is deactivated.

ProtectedViewWindowOpen

Occurs when a protected view window is opened.

ProtectedViewWindowSize

Quit

Occurs when the user exits Microsoft Word.

WindowActivate

Occurs when any document window is activated.

WindowBeforeDoubleClick

Occurs when the editing area of a document window is double-clicked, before the default double-click action.

WindowBeforeRightClick

Occurs when the editing area of a document window is right-clicked, before the default right-click action.

WindowDeactivate

Occurs when any document window is deactivated.

WindowSelectionChange

Occurs when the selection changes in the active document window.

WindowSize

Occurs when the application window is resized or moved.

XMLSelectionChange

Occurs when the parent XML node of the current selection changes.

XMLValidationError

Occurs when there is a validation error in the document.