Application.DocSize 方法 (Project)
设置活动窗口的宽度和高度。
语法
expression。 DocSize
( _Width_
, _Height_
, _Points_
)
expression:表示 Application 对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
Width | 可选 | Long | 用于指定活动窗口新宽度的数字。 |
Height | 可选 | Long | 用于指定活动窗口新高度的数字。 |
Points | 可选 | Boolean | 如此 如果 宽度 和 高度 以磅为单位。 假 如果他们以像素为单位来衡量。 默认值为 False。 |
返回值
Boolean
示例
下面的示例平铺打开的项目,在项目的主窗口中垂直方向的窗口。
Sub TileProjectWindowsVertically()
Dim I As Long ' Index used in For...Next loop
For I = 1 To Application.Windows.Count
Windows(I).Activate
DocSize Width:=UsableWidth / Windows.Count, Height:=UsableHeight, Points:=True
DocMove XPosition:=(I - 1) * UsableWidth / Windows.Count, YPosition:=0, Points:=True
Next I
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。