Application.TextStyles32Ex method (Project)

Sets the text styles for tasks and resources in the active view, where colors can be hexadecimal RGB values.

Syntax

expression.TextStyles32Ex (Item, Font, Size, Bold, Italic, Underline, Color, CellColor, Pattern)

expression An expression that returns an Application object.

Parameters

Name Required/Optional Data type Description
Item Optional Integer The type of text to change. Can be one of the following PjTextItem constants. See If the Gantt Chart is active.
Font Optional String The name of the font. The Font argument is ignored if the active view is the Network Diagram, and Item is not pjAll.
Size Optional Integer The size of the font in points. The Size argument is ignored if the active view is the Network Diagram, and Item is not pjAll.
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 for the RGB color, where red is the last byte. For example, the value &HFF0000 is blue and &H00FFFF is yellow.
CellColor Optional Long The background color of the cell. Can be a hexadecimal value for the RGB color.
Pattern Optional Integer The background pattern of the cell. Can be one of the PjBackgroundPattern constants.

If the Gantt Chart is active

Gantt Chart Active Gantt Chart Active Continued
pjAll pjGanttMajorTimescale
pjNoncritical pjGanttMinorTimescale
pjCritical pjBarTextLeft
pjMilestone pjBarTextRight
pjSummary pjBarTextTop
pjProjectSummary pjBarTextBottom
pjMarked pjBarTextInside
pjTaskFilterHighlight pjGanttExternalTask
pjTaskRowColumnTitles

If the Task Usage view is active

Task Usage Task Usage Continued
pjAll pjTaskFilterHighlight
pjCritical pjTaskMajorTimescale
pjMarked pjTaskMinorTimescale
pjMilestone pjTaskRowColumnTitles
pjNoncritical pjTaskUsageAssignmentRow
pjProjectSummary pjTaskUsageExternalTask
pjSummary

If the Task Sheet is active

Task Sheet 1 Task Sheet 2
pjAll pjGanttMajorTimescale
pjNoncritical pjGanttMinorTimescale
pjCritical pjBarTextLeft
pjMilestone pjBarTextRight
pjSummary pjBarTextTop
pjProjectSummary pjBarTextBottom
pjMarked pjBarTextInside
pjTaskFilterHighlight pjGanttExternalTask
pjTaskRowColumnTitles
Task Sheet 3 Task Sheet 4
pjAll pjTaskFilterHighlight
pjCritical pjTaskMajorTimescale
pjMarked pjTaskMinorTimescale
pjMilestone pjTaskRowColumnTitles
pjNoncritical pjTaskUsageAssignmentRow
pjProjectSummary pjTaskUsageExternalTask
pjSummary
Task Sheet 5 Task Sheet 6
pjAll pjProjectSummary
pjCritical pjSummary
pjMarked pjTaskSheetExternalTask
pjMilestone pjTaskFilterHighlight
pjNoncritical pjTaskRowColumnTitles

Return value

Boolean

Remarks

Using the TextStyles32Ex method without specifying any arguments displays the Text Styles dialog box.

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 TextStyles32Ex method is a very dark red. To use only the sixteen colors available with PjColor constants, use the TextStylesEx 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.