You can do what you want without any VBA or with some VBA if you like.
First - go to format menu/barstyles and create a bar style that is the color
they want.
In the "show for" column select Flag1 (or any other flag field)
Now set flag 1 to true for that task (either by filling in the field
manually or by supplying a custom formula for that field or by using a VBA
macro to programmatically set the value) and the bar will show. If you make
the new bar so that it covers any other bars and put it last in the list you
will have no problem.
You can also create a highlight filter which will turn the text (on the left
side) whatever color you want.
Sub Macro1()
FilterEdit Name:="Foo", TaskFilter:=True, Create:=True,
OverwriteExisting:=True, FieldName:="Flag1", Test:="equals", Value:="yes",
ShowInMenu:=True, ShowSummaryTasks:=False
FilterApply Name:="Foo", Highlight:=True
TextStyles Item:=7, Size:="12"
End Sub
WHat are the criteria they want to use?
Steve said:
Thanks for confirming what I thought. Could you expand on the
statement "but you can set it". Programically how do I set it? I
assume using GanttBarFormat TaskID:=74, GanttStyle:=SomeOtherValue.
Just as importantly, if I cannot read the apparently non existant
'Style collection', how would I know what value to use? As I
understand it each file that this code will be applied to, can have
different styles defined and I am unsure as to how you can know what
the summary style index will be in each file
The situation I am in in that I am a power VBA user within my company
and another colleague has turned to me for help with Project, which is
not my strongest area. His bosses want to see a printed gannt chart
that inludes all tasks, but have some of them highlighted according to
criteria. Their thinking was that the bars should be differenet
colours. Is there a more Project way of achieving this?
Thanks for any help
Steve
--
Please try to keep replies in this group. I do check e-mail, but only
infrequently.
For Macros and other things check
http://masamiki.com/project
-Jack Dahlgren, Project MVP
email: J -at- eM Vee Pee S dot COM
+++++++++++++++++++