Application.TextStylesEx method (Project)

Sets the text styles for tasks and resources in the active view.

Syntax

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

expression A variable that represents 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 one of the PjColor constants (see the PjColor constants table).
CellColor Optional Long The background color of the cell. Can be one of the PjColor constants.
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

PjColor constants

PjColor Pj Color Continued
pjColorAutomatic pjNavy
pjAqua pjOlive
pjBlack pjPurple
pjBlue pjRed
pjFuchsia pjSilver
pjGray pjTeal
pjGreen pjYellow
pjLime pjWhite
pjMaroon

Return value

Boolean

Remarks

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

To set the text style by using hexadecimal RGB values, see the TextStyles32Ex 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.