title | keywords | f1_keywords | ms.service | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|---|
Application.LinkTasks method (Project) |
vbapj.chm210 |
|
project-server |
|
cc41c963-533c-97bf-8301-388bb2aaf746 |
06/08/2017 |
medium |
Links the selected tasks in the Gantt Chart, Calendar, Task Sheet, or Task Usage view.
expression. LinkTasks
expression A variable that represents an Application object.
Boolean
The following example a couple of tasks and links them.
Sub Link_Tasks()
'Activate Task Sheet view
ViewApply Name:="Task Sheet"
' Create a coupe of tasks
RowInsert
SetTaskField Field:="Name", Value:="TestTask-2"
SetTaskField Field:="Duration", Value:="5"
RowInsert
SetTaskField Field:="Name", Value:="TestTask-1"
SetTaskField Field:="Duration", Value:="10"
'Select tasks
SelectRow
SelectRow Row:=1, Add:=True
'Link the two tasks
LinkTasks
'delete the tasks
ActiveProject.Tasks("TestTask-1").Delete
ActiveProject.Tasks("TestTask-2").Delete
End Sub
[!includeSupport and feedback]