Project) (Application.TimescaleNonWorking 方法
設定非工作時間的格式。
語法
expression。 TimescaleNonWorking
( _Draw_
, _Calendar_
, _Color_
, _Pattern_
)
expression 代表 Application 物件的變數。
參數
名稱 | 必要/選用 | 資料類型 | 描述 |
---|---|---|---|
Draw | 選用 | Integer | 相對於甘特圖來表示非工作時間的方式。 可以是下列 PjNonWorkingPlacement 常數之一: pjBehind 、 pjInFront 或 pjDoNotDraw 。 |
Calendar | 選用 | String | 要設定格式的行事曆名稱 |
Color | 選用 | Integer | 非工作時間的色彩。 可以是 PjColor 常數的其中一個。 |
Pattern | 選用 | Integer | 非工作時間的圖樣。 可以為其中一個 PjFillPattern 常數。 |
傳回值
布林值
註解
使用 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 支援與意見反應。