Share via


Task.ActualDuration プロパティ (Project)

取得またはタスクの実績期間 (分単位で) を設定します。 サマリー タスクに対しては読み取り専用です。 値の取得と設定が可能なバリアント型 (Variant) の値です。

構文

ActualDuration

Task オブジェクトを表す変数。

次の使用例は、作業中のプロジェクトで、実績期間が指定した時間を超えるタスクにマークを付けます。

Sub MarkLongDurationTasks() 
 
 Dim T As Task ' Task object used in For Each loop 
 Dim Minutes As Long ' Duration entered by user 
 
 ' Prompt user for the actual duration, in minutes. 
 Minutes = Val(InputBox$("Enter the actual duration, in minutes: ")) 
 
 ' Don't do anything if the InputBox$ was cancelled. 
 If Minutes = 0 Then Exit Sub 
 
 ' Cycle through the tasks of the active project. 
 For Each T In ActiveProject.Tasks 
 ' Mark a task if it exceeds the duration. 
 If T.ActualDuration > Minutes Then T.Marked = True 
 Next T 
 
End Sub

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

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