Application.DetailStylesFormat method (Project)
Sets the format of timescaled data fields in a Resource Usage view or Task Usage view.
Syntax
expression. DetailStylesFormat
( _Item_
, _Font_
, _Size_
, _Bold_
, _Italic_
, _Underline_
, _Color_
, _CellColor_
, _Pattern_
, _ShowInMenu_
)
expression A variable that represents 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 one of the PjColor constants. |
CellColor | Optional | Long | The color of the cell background. Can be one of the PjColor constants. |
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. |
Return value
Boolean
Remarks
Using the DetailStylesFormat method without specifying any arguments displays the Detail Styles dialog box with the Usage Details tab selected.
To edit the timescale data where the text and cell color can be a hexadecimal RGB value, and the font can include the strikethrough style, use the DetailStylesFormatEx method.
Example
The following example makes overallocations stand out from other information in a usage view.
Sub HighlightOverallocations()
DetailStylesAdd pjOverallocation
DetailStylesFormat Item:=pjOverallocation, Font:="Arial", Size:=10, _
Bold:=True, Color:=pjRed, CellColor:=pjBlack, Pattern:=pjSolidFill
End Sub
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.