StartDriver.EffectiveDateAdd 屬性(專案)StartDriver.EffectiveDateAdd property (Project)

會取得的日期和時間另一個日期後面依指定工期排使用手動排程任務的有效行事曆。Gets the date and time that follows another date by a specified duration, using the effective calendar for a manually scheduled task. 唯讀的VariantRead-only Variant.

語法Syntax

expressionexpression. EffectiveDateAdd( _Date_, _Duration_ )EffectiveDateAdd( _Date_, _Duration_ )

_運算式_會傳回StartDriver物件的運算式。expression An expression that returns a StartDriver object.

參數Parameters

名稱Name 必要/選用Required/Optional 資料類型Data type 描述Description
DateDate 必要Required VariantVariant 任意日期和時間,例如 "7/10/2010" 或 "7/10/2010 2:00:00 PM"。Arbitrary date and time, for example, "7/10/2010" or "7/10/2010 2:00:00 PM".
DurationDuration 必要Required VariantVariant 要加上的工期,例如 "3d" 或 "2w"。Duration to add, for example, "3d" or "2w".

註解Remarks

EffectiveDateAdd 屬性使用的有效行事曆手動排程任務的可讓要開始和結束在非工作時間的任務。The EffectiveDateAdd property uses the effective calendar for manually scheduled tasks, which allows tasks to start and finish on non-working times. 屬性和引數可以不會影響實際任務的日期。The property and arguments have no effect on actual task dates.

您可以使用 EffectiveDateSubtractEffectiveDateAddEffectiveDateDifference 屬性來計算開始和完成手動排程任務的日期。You can use the EffectiveDateSubtract, EffectiveDateAdd, and EffectiveDateDifference properties to calculate start and finish dates for manually scheduled tasks.

若要計算自動排程任務的日期 (您也可以在其中指定行事曆),請使用 DateAdd 方法。To calculate a date for an automatically scheduled task, where you can also specify the calendar, use the DateAdd method.

範例Example

下列陳述式會傳回值 "7/9/2009 5:00:00 PM",是指定日期的六天後。The following statement returns the value "7/9/2009 5:00:00 PM", which is six days after the specified date.

Debug.Print ActiveProject.Tasks(3).StartDriver.EffectiveDateAdd("7/2/2009", "6d")

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.