Table of contents
TOC
Collapse the table of content
Expand the table of content

Project.CurrentDate Property (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

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

Syntax

expression. CurrentDate

expression A variable that represents a Project object.

Remarks

When a project opens, Project 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.

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
© 2018 Microsoft