Adding Tasks to the Timeline with VBA

Toodling around in MPP 2013 today and came up with this quick code.  It runs through each task and adds the ones flagged in the Flag1 field to the timeline.  Note this is barely tested – and I would assume it needs to be run on a view where the timeline actually appears.

Sub AddTasktoTimeline()

    Dim T As Task
    For Each T In ActiveProject.Tasks
        If T.Flag1 = True Then
            SelectRow Row:=T.ID, RowRelative:=False
            TaskOnTimeline
        Else
            SelectRow Row:=T.ID, RowRelative:=False
            TaskOnTimeline Remove:=True
        End If
    Next T

End Sub

Advertisements
Adding Tasks to the Timeline with VBA

One thought on “Adding Tasks to the Timeline with VBA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s