Project.CurrentDate Property

Project Developer Reference

Returns or sets the current date for a project. Read/write Variant.

Syntax

expression.CurrentDate

expression   A variable that represents a Project object.

Return Value
Variant

Remarks
When a project opens, Microsoft Office Project 2007 automatically sets the project's current date equal to the system date.

Example
The following example sets the current date of the active project to the previous Monday.

Visual Basic for Applications
  Sub SetCurrentDateToPreviousMonday()
' Loop while the current date is not Monday.
Do While WeekDay(ActiveProject.<strong class="bterm">CurrentDate</strong>) &lt;&gt; pjMonday
    ' Subtract one day from the current date.
    ActiveProject.<strong class="bterm">CurrentDate</strong> = _
        DateSerial(Year(ActiveProject.<strong class="bterm">CurrentDate</strong>), _
        Month(ActiveProject.<strong class="bterm">CurrentDate</strong>), _
        Day(ActiveProject.<strong class="bterm">CurrentDate</strong> - 1))
Loop

End Sub

See Also