Skip to content

Latest commit

 

History

History
91 lines (54 loc) · 1.94 KB

Project.Day.md

File metadata and controls

91 lines (54 loc) · 1.94 KB
title ms.service api_name ms.assetid ms.date ms.localizationpriority
Day object (Project)
project-server
Project.Day
411fe04f-b68d-08c2-8b6c-f2c1e9927a34
06/08/2017
medium

Day object (Project)

Represents a day in a month. The Day object is a member of the Days collection.

Example

Using the Day Object

Use Days (Index ), whereIndex is the day index number or PjWeekday constant, to return a single Day object. The following example counts the number of working days in the month of September 2008 for each selected resource.

Dim R As Resource, D As Integer, WorkingDays As Integer 
 
For Each R In ActiveSelection.Resources() 
    WorkingDays = 0 
    With R.Calendar.Years(2008).Months(pjSeptember) 
        For D = 1 To .Days.Count 
            If .Days(D).Working = True Then 
                WorkingDays = WorkingDays + 1 
            End If 
        Next D 
    End With 
    MsgBox "There are " & WorkingDays & " working days in " _ 
        & R.Name & "'s calendar." 
Next R

Using the Days Collection

Use the Days property to return a Days collection. The following example counts the number of working days in the month of September 2008.

ActiveProject.Calendar.Years(2008).Months(pjSeptember).Days.Count

Methods

Name
Default

Properties

Name
Application
Calendar
Count
Index
Name
Parent
Shift1
Shift2
Shift3
Shift4
Shift5
Working

[!includeSupport and feedback]