title | keywords | f1_keywords | ms.service | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|---|
Application.TaskOnTimeline method (Project) |
vbapj.chm60 |
|
project-server |
|
8201380b-f0ae-4e53-7461-e323ad6fe5e2 |
06/08/2017 |
medium |
Manages tasks on the Timeline pane or for a specified custom timeline.
expression. TaskOnTimeline
( _TaskID_
, _Remove_
, _TimelineViewName_
)
expression An expression that returns an Application object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
TaskID | Optional | Long | Specifies the identification number of a task to add to the timeline or remove from the timeline. If TaskID is specified, selected tasks are ignored. |
Remove | Optional | Boolean | True if the task specified by TaskID or the selected tasks are removed from the timeline; otherwise, False. The default value is False. |
TimelineViewName | Optional | String | Specifies the name of a timeline to use. The name can be the built-in "Timeline" or an existing custom timeline such as "My Timeline". The default value is the name of the active timeline. |
ShowDialog | Optional | Boolean | True if Project displays the Add Tasks to Timeline dialog box; otherwise, False. Any tasks that are already on the timeline have a check by their names. If ShowDialog is True, Project ignores the TaskID and Remove arguments. The default value is False. |
Boolean
Running TaskOnTimeline with no arguments puts selected tasks on the active timeline.
If the project includes custom timeline views, using the TimelineViewName argument activates the specified timeline, and then applies changes specified by the other arguments. If the specified timeline does not exist, TaskOnTimeline takes no action, but still returns True.
The following statement removes selected tasks from the timeline. You can select the tasks in the Gantt Chart or on the timeline.
application.TaskOnTimeline Remove:=True
If the built-in Timeline pane is active and a custom timeline named "My Timeline" exists, the following statement replaces the Timeline pane with "My Timeline", and then adds task 3 to the custom timeline.
application.TaskOnTimeline TaskID:=3, TimelineViewName:="My Timeline"
[!includeSupport and feedback]