Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.2 KB

Project.Project.CurrentDate.md

File metadata and controls

50 lines (34 loc) · 1.2 KB
title keywords f1_keywords ms.service api_name ms.assetid ms.date ms.localizationpriority
Project.CurrentDate property (Project)
vbapj.chm131699
vbapj.chm131699
project-server
Project.Project.CurrentDate
008da48d-2bc8-f69c-c0d1-1b44a57c1c69
06/08/2017
medium

Project.CurrentDate property (Project)

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

[!includeSupport and feedback]