DocumentChange Event

Applies To

Application object.

Description

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

Syntax

Private Sub object_DocumentChange( )

object An object of type Application declared with events in a class module.

See Also

Close event, GotFocus event, LostFocus event, New event, Open event, Quit event.

Example

This example arranges all open windows when the document focus changes.

Private Sub myApp_DocumentChange()
    Application.Windows.Arrange wdTiled
End Sub