Application.AppSize method (Project)

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 Project to the left half of the screen.

Sub MoveMainWindowToLeftHalf() 
 
    Dim WindowHeight As Long 
     
    ' Remember the height when maximized. 
    Application.WindowState = pjMaximized 
    WindowHeight = Application.Height 
     
    AppSize Width:=UsableWidth / 2, Height:=UsableHeight, Points:=True 
    Application.Left = 0 
    ' Be sure the window uses all the available height. 
    If Application.Height < WindowHeight Then Application.Height = WindowHeight 
     
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.