Application.AppSize 方法 (Project)

设置主窗口的宽度和高度。

语法

expressionAppSize( _Width_, _Height_, _Points_ )

expression:表示 Application 对象的变量。

参数

名称 必需/可选 数据类型 说明
Width 可选 Long 一个数字,指定主窗口的新宽度。
Height 可选 Long 一个数字,指定主窗口的新高度。
Points 可选 Boolean 如此 如果 宽度高度 以磅为单位。 如果他们以像素为单位来衡量。 默认值为 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。