How do i test for a font color in Task cell ?

G

Gary

I know you can set font color with this:
SelectRow T.UniqueID, RowRelative:=False
SelectTaskField Row:=T.UniqueID, RowRelative:=False, Column:="Finish"
Font Color:=pjRed, Bold:=True

How dio I test for a font color. This doesn't compile:

If Font(Color = pjBlack) Then ' DOESN'tT Compile
' actions here
End If
 
J

John

Gary said:
I know you can set font color with this:
SelectRow T.UniqueID, RowRelative:=False
SelectTaskField Row:=T.UniqueID, RowRelative:=False, Column:="Finish"
Font Color:=pjRed, Bold:=True

How dio I test for a font color. This doesn't compile:

If Font(Color = pjBlack) Then ' DOESN'tT Compile
' actions here
End If

Gary,
Sorry, unlike some other Office applications Project does not make the
font property available for reading. You will have to determine font
characteristics indirectly. So what does that mean? Well, unless the
user applied totally random font characteristics, there should be some
underlying criteria for font characteristics. For example, summary lines
are bold. Perhaps a particular task type is red, etc. You will need to
test for the criteria in order to determine the font characteristics.

Not the answer you wanted, but it's the way Project is set up.

John
Project MVP
 
G

Gary

John said:
Gary,
Sorry, unlike some other Office applications Project does not make the
font property available for reading. You will have to determine font
characteristics indirectly. So what does that mean? Well, unless the
user applied totally random font characteristics, there should be some
underlying criteria for font characteristics. For example, summary lines
are bold. Perhaps a particular task type is red, etc. You will need to
test for the criteria in order to determine the font characteristics.

Not the answer you wanted, but it's the way Project is set up.

John
Project MVP

Ouch !! I need to make some massive changes to a color and also make
reports on a specific color. I was hoping there was a way to find these
colors from code.
 
J

Jack Dahlgren MVP

I always discourage individual cell formatting unless it is conditional
(based on the value of some other field).
For example, a flag field may indicate that a bar should be one color or
another.
You could open the file and set the flag field manually for the rows you
want to change, then run your code. It might be faster.
Or you could simply flag them, then filter on that flag, then select all and
format.

-Jack Dahlgren
 
G

Gary

I inherited this Project file and now must maintain it. I want to follow
suggestions you are making but I need to identify several colors to help fix
"holes" in the schedule.

Any window GUI routines that might help?

Gary
 
J

John

Gary said:
I inherited this Project file and now must maintain it. I want to follow
suggestions you are making but I need to identify several colors to help fix
"holes" in the schedule.

Any window GUI routines that might help?

Gary

Gary,
The bottom line is that you will have to determine what criteria was
used to set the font characteristics. If you're lucky you can contact
the originator of the file and ask. If you're less lucky, you get to do
a little detective work.

Go for it.

John
Project MVP
 

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