Selection.Tasks property (Project)

Gets a Tasks collection representing the tasks in the selection. Read-only Tasks.

Syntax

expression. Tasks

expression A variable that represents a Selection object.

Example

The following example displays the name of every task in the selection.

Sub TaskNames() 
 
 Dim T As Task, Names As String 
 
 For Each T In ActiveSelection.Tasks 
 Names = Names & T.Name & vbCrLf 
 Next T 
 
 MsgBox Names 
 
End Sub

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.