Table of contents
Collapse the table of content
Expand the table of content

Application.DetailStylesFormatEx Method (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Sets the format of timescaled data fields in a Resource Usage view or Task Usage view, where colors can be hexadecimal values.


expression. DetailStylesFormatEx( ** Item, ** Font, ** Size, ** Bold, ** Italic, ** Underline, ** Color, ** CellColor, ** Pattern, ** ShowInMenu, ** Strikethrough** )

expression An expression that returns an Application object.


NameRequired/OptionalData TypeDescription
ItemOptionalLongThe timescaled data field to format. If the active view is the Task Usage view, the value can be one of the PjTaskTimescaledData constants. If the active view is the Resource Usage view, the value can be one of the PjResourceTimescaledData constants.
FontOptionalStringThe name of the font.
SizeOptionalIntegerThe size of the font in points.
BoldOptionalBooleanTrue if the font is bold; otherwise, False.
ItalicOptionalBooleanTrue if the font is italic; otherwise, False.
UnderlineOptionalBooleanTrue if the font is underlined; otherwise, False.
ColorOptionalLongThe color of the font. Can be a hexadecimal value, where red is the last byte. For example, the value &;HFF0000 is blue and &;H00FFFF is yellow.
CellColorOptionalLongThe color of the cell background. Can be a hexadecimal value, where red is the last byte. For example, the value &;HFF00 is green.
PatternOptionalLongThe pattern for nonworking times. Can be one of the PjFillPattern constants.
ShowInMenuOptionalBooleanTrue if the field specified with Item appears in the shortcut menu; otherwise, False. The default value is False.
StrikethroughOptionalVariantTrue if the font is the strikethrough style.

Return Value



Using the DetailStylesFormat method without specifying any arguments displays the Detail Styles dialog box with the Usage Details tab selected.


The following example makes overallocations stand out from other information in a usage view.

Sub HighlightOverallocations() 
    DetailStylesAdd pjOverallocation 
    DetailStylesFormatEx Item:=pjOverallocation, Font:="Arial", Size:=10, _ 
        Bold:=True, Color:=&;HA0, CellColor:=&;HFFB0B0, Pattern:=pjSolidFill 
End Sub

Note If you use any of the PjColor enumeration constants for the Color or CellColor parameters, the color will be nearly black. For example, the value of pjGreen is 9, which in the DetailStylesFormatEx method is a very dark red. To use only the sixteen colors available with PjColor constants, use the DetailStylesFormat method.

© 2018 Microsoft