Share via


WindowSize Event

Occurs when the application window is resized or moved.

Private Subobject**_WindowSize**(ByVal Doc As Document, ByVal Wn As Window)

object An object of type Application declared with events in a class module. For information about using events with the Application object, see Using Events with the Application Object .

Doc The document in the window being sized.

Wn 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.

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

Applies to | Application Object