title | keywords | f1_keywords | ms.service | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|---|
Project.CurrentDate property (Project) |
vbapj.chm131699 |
|
project-server |
|
008da48d-2bc8-f69c-c0d1-1b44a57c1c69 |
06/08/2017 |
medium |
Gets or sets the current date for a project. Read/write Variant.
expression. CurrentDate
expression A variable that represents a Project object.
When a project opens, Project automatically sets the project's current date equal to the system date.
The following example sets the current date of the active project to the previous Monday.
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
[!includeSupport and feedback]