summary and indicator quesitions

J

Joy

1. I want to delete summary task, and leave children tasks. How can i do that
2. I want to copy all fields of one task, say A to another task, say B.
other fileds seem fine, only Indicators.

can I do like this:
Set B = ActiveProject.Tasks.Add(A.Name)

B.SetField pjTaskIndicators, A.Indicators

seems results not OK


thanks
 
J

Jack Dahlgren MVP

for #1

This is the basic code from memory, so there may be syntax errors or other
issues.

dim childTasks as tasks
dim sumTask as task
dim childT as task
dim i as integer
set childTasks = sumTask.outlinechildren
'this next part is tricky because if you outdent a task but not the other
tasks it may become a summary task itself and you will lose data
for i = childtasks.count to 1 step -1
set childt = childtasks(i)
childt.outlinelevel = childt.outlinelevel + 1
next
sumtask.delete

Of course if you have other stuff nested under there you will have to do
this recursively.

-Jack
 
J

Joy

very helpful

Jack Dahlgren MVP said:
for #1

This is the basic code from memory, so there may be syntax errors or other
issues.

dim childTasks as tasks
dim sumTask as task
dim childT as task
dim i as integer
set childTasks = sumTask.outlinechildren
'this next part is tricky because if you outdent a task but not the other
tasks it may become a summary task itself and you will lose data
for i = childtasks.count to 1 step -1
set childt = childtasks(i)
childt.outlinelevel = childt.outlinelevel + 1
next
sumtask.delete

Of course if you have other stuff nested under there you will have to do
this recursively.

-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