Share via


Application.AppSize Method

Project Developer Reference

Sets the width and height of the main window.

Syntax

expression.AppSize(Width, Height, Points)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Width Optional Long A number that specifies the new width of the main window.
Height Optional Long A number that specifies the new height of the main window.
Points Optional Boolean True if Width and Height are measured in points. False if they are measured in pixels. The default value is False.

Return Value
Boolean

Example
The following example moves the main window of Microsoft Office Project 2007 to the left half of the screen.

Visual Basic for Applications
  Sub MoveMainWindowToLeftHalf()
Dim WindowHeight As Long

' Remember the height when maximized.
Application.WindowState = pjMaximized
WindowHeight = Application.Height

<strong class="bterm">AppSize</strong> Width:=UsableWidth / 2, Height:=UsableHeight, Points:=True
Application.Left = 0
' Be sure the window uses all the available height.
If Application.Height &lt; WindowHeight Then Application.Height = WindowHeight

End Sub

See Also