共用方式為


Project.CurrentDate 屬性 (Project)

會取得或設定專案的目前日期。 可讀寫的 Variant

語法

expressionCurrentDate

表達 代表 Project 物件的變數。

註解

專案開啟時,Project 自動設定專案的目前日期等於系統日期。

範例

下面範例會將使用中專案的目前日期設定為上星期一。

Sub SetCurrentDateToPreviousMonday()
    ' Loop while the current date is not Monday. 
    Do While WeekDay(ActiveProject.CurrentDate) <> pjMonday 
        ' Subtract one day from the current date. 
        ActiveProject.CurrentDate = _ 
            DateSerial(Year(ActiveProject.CurrentDate), _ 
            Month(ActiveProject.CurrentDate), _ 
            Day(ActiveProject.CurrentDate - 1)) 
    Loop
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應