设置非工作时间的格式。
语法
expression。 TimescaleNonWorking( _Draw_, _Calendar_, _Color_, _Pattern_ )
expression:表示 Application 对象的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 说明 |
|---|---|---|---|
| Draw | 可选 | Integer | 相对于甘特条形图表示非工作时间的方式。 可以是下列的 PjNonWorkingPlacement 常量之一: pjBehind 、 pjInFront 或 pjDoNotDraw 。 |
| Calendar | 可选 | String | 要进行格式设置的日历的名称。 |
| Color | 可选 | Integer | 非工作时间的颜色。 可以是 PjColor 常量之一。 |
| Pattern | 可选 | Integer | 非工作时间的图案。 可以是 PjFillPattern 常量之一。 |
返回值
Boolean
说明
使用未指定任何参数的 TimescaleNonWorking 方法将显示 时间刻度对话框中选择 非工作时间选项卡。
若要使用十六进制 RGB 颜色值设置非工作时间的格式,请参阅 TimescaleNonWorkingEx 。
示例
以下示例将在任务条形图后面使用红色绘制非工作时间。
Sub Timescale_NonWorking()
'Sets nonworking time behind the task bars to red.
'Activate Gantt Chart.
ViewApply Name:="&Gantt Chart"
TimescaleNonWorking Draw:=pjBehind, Color:=pjRed
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。