Task.Milestone property (Project)

True if the task is a milestone. Read/write Variant.

Syntax

expression. Milestone

expression A variable that represents a Task object.

Example

The following example marks as milestones any tasks in the active project with names that begin with the word "Inspection."

Sub MarkInspectionTasks() 
 
 Dim T As Task ' Task object used in For Each loop 
 Dim MilestoneName As String 
 Dim NameLength As Integer 
 
 MilestoneName = "Inspection" 
 NameLength = Len(MilestoneName) 
 
 For Each T In ActiveProject.Tasks 
 ' If the task's name begins with Inspection, it's a milestone. 
 If UCase(Left(T.Name, NameLength)) = UCase(MilestoneName) Then 
 T.Milestone = True 
 End If 
 Next T 
 
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.