Change Milestone task color and Summary Task Gantt Bar

A

amin

hi

i have two proplems if you can help me.

1. To change in MS.Project Milestone tasks color in the Gantt Bar. i
try to use the GanttBarFormat function but it's not effective on
milestone task

2. the second problem is : if i have summary task and this Summary is
milestone , i can't change the Gantt Bar Start Shape and End Shape for
this task . and by macro in ms.msproject i can't change it .

in the both problems i use the GanttBarFormat :
1. in the first problem i choose the same foreach but with
PjColor.pjRed;

foreach (Task task in app.ActiveProject.Tasks)
{
app.GanttBarFormat( task.ID,
Missing.Value, PjBarEndShape.pjDiamond, PjBarType.pjSolid ,
PjColor.pjBlack,
PjShape.pjRectangle,
PjFillPattern.pjSolidFillPattern, PjColor.pjBlack,
PjBarEndShape.pjDiamond,PjBarType.pjSolid , PjColor.pjBlack
, Missing.Value,Missing.Value, Missing.Value,
Missing.Value,
Missing.Value, false, Missing.Value);
}

thanks
amin
(e-mail address removed)
 
D

davegb

amin said:
hi

i have two proplems if you can help me.

1. To change in MS.Project Milestone tasks color in the Gantt Bar. i
try to use the GanttBarFormat function but it's not effective on
milestone task

2. the second problem is : if i have summary task and this Summary is
milestone , i can't change the Gantt Bar Start Shape and End Shape for
this task . and by macro in ms.msproject i can't change it .

in the both problems i use the GanttBarFormat :
1. in the first problem i choose the same foreach but with
PjColor.pjRed;

foreach (Task task in app.ActiveProject.Tasks)
{
app.GanttBarFormat( task.ID,
Missing.Value, PjBarEndShape.pjDiamond, PjBarType.pjSolid ,
PjColor.pjBlack,
PjShape.pjRectangle,
PjFillPattern.pjSolidFillPattern, PjColor.pjBlack,
PjBarEndShape.pjDiamond,PjBarType.pjSolid , PjColor.pjBlack
, Missing.Value,Missing.Value, Missing.Value,
Missing.Value,
Missing.Value, false, Missing.Value);
}

thanks
amin
(e-mail address removed)

I don't have Project on this machine to test your code. Others can help
you there. As far as a Summary task being a Milestone, I don't think
that's a good idea, and I'm not sure you can even do that in Project
(and probably someone will tell you that you shouldn't even be thinking
about it!). A Summary task represents a group of subtasks. Some of
these might be milestones (zero duration activities), but why would all
of them be? If you have nothing but milestones, by definition, nothing
is happening. No work, no cost, nothing. So how do you summarize a
group of nothings? Milestones represent major progress/decision points
in your project. Without working tasks leading up to them, with the
exception of a "Start Project" milestone, what would you be marking?
You could have a milestone marking the beginning or end of a Summary
task, usually if it's a major phase or needs to be linked to other
tasks. But I can't think of a legitimate situation where a Summary Task
should be shown as a milestone.
Of course, if you have a boss who doesn't understand all this and won't
listen to logic, you could just change the symbol for Summary tasks to
the same symbol as a milestone. This will change ALL summary tasks to
milestones.
 
J

Jan De Messemaeker

Hi Dave (and Amin)

I as well thought this was impossible, but it isn't.
The graphical representation is both the summary bar and the milestone sign
superimposed.
Amin, I have a problem with your code which will run on all tasks
irrespective of whether they are milestones, summary or not.
If you want to change the styles of all milestone bars, you should not loop
through the taks using GanttBarformat but use GantBarStyleEdit instead.
Hope this helps,
 
A

amin

Jan De Messemaeker כתב:
Hi Dave (and Amin)

I as well thought this was impossible, but it isn't.
The graphical representation is both the summary bar and the milestone sign
superimposed.
Amin, I have a problem with your code which will run on all tasks
irrespective of whether they are milestones, summary or not.
If you want to change the styles of all milestone bars, you should not loop
through the taks using GanttBarformat but use GantBarStyleEdit instead.
Hope this helps,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
http://users.online.be/prom-ade/
+32-495-300 620

hi all

Jan:
it's true , that's my code must not run for all the tasks, I know that
I must wrote-
if (task.milestone) in the for Loop and then i change color , or in
the second problem i must check if the task is Milestone and Summery .
but i wrote it just to clear my question .


Dav:
My Program collect information from other programs and View it in
MS.Project , so i can't compel the logical in Ms.project in another
programs.

thanks
 
J

Jan De Messemaeker

OK Amin,

My advice still is to use GanttBarStyles.
HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
http://users.online.be/prom-ade/
+32-495-300 620
"amin" <[email protected]> schreef in bericht

Jan De Messemaeker ???:
Hi Dave (and Amin)

I as well thought this was impossible, but it isn't.
The graphical representation is both the summary bar and the milestone sign
superimposed.
Amin, I have a problem with your code which will run on all tasks
irrespective of whether they are milestones, summary or not.
If you want to change the styles of all milestone bars, you should not loop
through the taks using GanttBarformat but use GantBarStyleEdit instead.
Hope this helps,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
http://users.online.be/prom-ade/
+32-495-300 620

hi all

Jan:
it's true , that's my code must not run for all the tasks, I know that
I must wrote-
if (task.milestone) in the for Loop and then i change color , or in
the second problem i must check if the task is Milestone and Summery .
but i wrote it just to clear my question .


Dav:
My Program collect information from other programs and View it in
MS.Project , so i can't compel the logical in Ms.project in another
programs.

thanks
 

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