Application.DetailStylesFormatEx method (Project)

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

Syntax

expression. DetailStylesFormatEx( _Item_, _Font_, _Size_, _Bold_, _Italic_, _Underline_, _Color_, _CellColor_, _Pattern_, _ShowInMenu_, _Strikethrough_ )

expression An expression that returns an Application object.

Parameters

Name Required/Optional Data type Description
Item Optional Long The 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.
Font Optional String The name of the font.
Size Optional Integer The size of the font in points.
Bold Optional Boolean True if the font is bold; otherwise, False.
Italic Optional Boolean True if the font is italic; otherwise, False.
Underline Optional Boolean True if the font is underlined; otherwise, False.
Color Optional Long The 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.
CellColor Optional Long The color of the cell background. Can be a hexadecimal value, where red is the last byte. For example, the value &HFF00 is green.
Pattern Optional Long The pattern for nonworking times. Can be one of the PjFillPattern constants.
ShowInMenu Optional Boolean True if the field specified with Item appears in the shortcut menu; otherwise, False. The default value is False.
Strikethrough Optional Variant True if the font is the strikethrough style.

Return value

Boolean

Remarks

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

Example

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.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.