Application.TaskMove method (Project)
Moves the start date of one or more selected tasks the specified number of days.
Syntax
expression. TaskMove
( _MoveForward_
, _IsWorkingDuration_
, _MoveDays_
)
expression An expression that returns an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
MoveForward | Optional | Variant | True if the task moves forward in time. False if the task moves backward in time. The default is True. |
IsWorkingDuration | Optional | Variant | True if the number of days specified by MoveDays is only for working days. False if the number of days specified by MoveDays includes both working and nonworking days. The default is True. |
MoveDays | Optional | Integer | Specifies the number of days to move the selected tasks. The default value is 1. |
Return value
Boolean
Remarks
The TaskMove method does not override a predecessor task constraint for automatically scheduled tasks.
The TaskMove method corresponds to various commands in the Move Task drop-down menu on the TASK ribbon. To move incomplete or complete parts of a task to the status date, use the TaskMoveToStatusDate method.
Example
For the following example, a selected task start date is Friday, 7/24/09. After running the statement, the start date of the task is Monday, 8/3/09. The start date of the task has moved forward eight working days.
Application.TaskMove MoveDays:=8
If the selected task is manually scheduled and has a predecessor task with a finish-to-start (FS) constraint, the following statement moves the selected task back one working day.
If you change the selected task to automatically scheduled, the statement can move the task back only as far as the finish date of the predecessor task.
Application.TaskMove MoveForward:=False
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.