Looping thru the Children of a summary task in VBA

J

JohnnyM

Hi all.

I need help writing code to loop thru all the children tasks of a
Summary task using VBA.

Sample Project:
Task1
Task2
TaskA
TaskB
TaskC

Given the name of the Task2, I need a loop to identify each of the
following TaskA, TaskB & TaskC.

Here is what I have so far:
==============================
Dim ChildTask as Task
Dim SummTask as Task
Dim Temp as integer

' This makes Task2 the active cell.
Temp = Proj.Application.Find("Name", "equals", "Task2")

Set SummTask = ActiveProject.Tasks(Proj.ActiveCell.Task.Name)
===============================

Here is what I need:
=============================

For each ChildTask of SummTask

Next Child


==============================

Thanks in advance!
John
 
J

JackD

dim ts as tasks
dim t as task
Set ts = SummTask.OutlineChildren
For Each t In ts
MsgBox t.Name
Next t


-Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top