Share via


Application.WindowSize Event

Word Developer Reference

Occurs when the application window is resized or moved.

Syntax

expression.Private Sub object_WindowSize(ByVal Doc As Document, ByVal Wn As Window)

expression   A variable that represents an Application object that has been declared with events in a class module. For information about using events with the Application object, see Using Events with the Application Object.

Parameters

Name Required/Optional Data Type Description
Doc Required Document The document in the window being sized.
Wn Required Window The window being sized.

Example

This example displays a message every time the Microsoft Word application window is moved or resized. This example assumes that you have declared an application variable called "WordApp" in your general declarations and have set the variable equal to the Word Application object.

Visual Basic for Applications
  Private Sub WordApp_WindowSize(ByVal Doc As Document, _
        ByVal Wn As Window)
    MsgBox "You have just resized or moved your window."
End Sub

See Also