次の方法で共有


Day オブジェクト (Project)

1 か月に 1 日を表します。 Day オブジェクトは、 Days コレクションのメンバーです。

Day オブジェクトを使用する

単一のDay オブジェクトを返すには、Days (Index) を使用します。Index は日インデックス番号または PjWeekday 定数です。 次の例では、選択された各リソースの 2008 年 9 月の月の稼働日の数をカウントします。

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

Days コレクションを使用する

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

メソッド

名前
Default

プロパティ

名前
Application
予定表
Count
インデックス
名前
Parent
Shift1
Shift2
Shift3
Shift4
Shift5
Working

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。