Application.AppSize メソッド (Project)

アプリケーション ウィンドウの幅と高さを設定します。

構文

expression。 AppSize( _Width_, _Height_, _Points_ )

expressionApplication オブジェクトを 表す変数。

パラメーター

名前 必須 / オプション データ型 説明
Width 省略可能 長整数型 (Long) アプリケーション ウィンドウの新しい幅を指定する数値を指定します。
Height 省略可能 長整数型 (Long) アプリケーション ウィンドウの新しい高さを指定する数値を指定します。
Points 省略可能 ブール型 (Boolean) 場合は true を指定の幅 と 高さ をポイント単位で指定されます。 False 場合は、ピクセル単位で測定されます。 既定値は False です。

戻り値

ブール型 (Boolean)

例

次の使用例は、画面の半分に左に、 Projectのメイン ウィンドウに移動します。

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

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。