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

Application.GanttBarFormatEx Method (Project)

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

Changes the formatting of Gantt bars from their default styles, where colors can be hexadecimal RGB values.

Syntax

expression. GanttBarFormatEx( ** TaskID, ** GanttStyle, ** StartShape, ** StartType, ** StartColor, ** MiddleShape, ** MiddlePattern, ** MiddleColor, ** EndShape, ** EndType, ** EndColor, ** LeftText, ** RightText, ** TopText, ** BottomText, ** InsideText, ** Reset, ** ProjectName )

expression An expression that returns an Application object.

Parameters

NameRequired/OptionalData TypeDescription
TaskIDOptionalLongThe identification number of the task to be changed on the Gantt chart. The default is to change the Gantt bars of the selected tasks.
GanttStyleOptionalIntegerThe style applied to the Gantt bar to be formatted. The value for GanttStyle is based on the position of the bar style in the Bar Styles dialog box. For example, the value 3 returns the third bar style in the list.
StartShapeOptionalIntegerThe start shape of the Gantt bar. Can be one of the PjBarEndShape constants.
StartTypeOptionalIntegerThe start type of the Gantt bar. Can be one of the PjBarType constants.
StartColorOptionalLongThe color of the start shape of the Gantt bar. Can be a hexadecimal RGB value, where red is the last byte. For example, &;H00FFFF is yellow.
MiddleShapeOptionalIntegerThe middle shape of the Gantt bar. Can be one of the PjBarShape constants.
MiddlePatternOptionalIntegerThe middle pattern of the Gantt bar. Can be one of the PjFillPattern constants.
MiddleColorOptionalLongThe color of the middle section Gantt bar. Can be a hexadecimal RGB value, where red is the last byte. For example, &;HFF00FF is purple.
EndShapeOptionalIntegerThe end shape of the Gantt bar. Can be one of the PjBarEndShape constants.
EndTypeOptionalIntegerThe end type of the Gantt bar. Can be one of the following PjBarType constants: pjDashed, pjFramed, or pjSolid.
EndColorOptionalLongThe color of the end shape of the Gantt bar. Can be a hexadecimal RGB value, where red is the last byte. For example, &;HFFFF00 is blue-green.
LeftTextOptionalStringThe task field to display to the left of the Gantt bar.
RightTextOptionalStringThe task field to display to the right of the Gantt bar.
TopTextOptionalStringThe task field to display above the Gantt bar.
BottomTextOptionalStringThe task field to display below the Gantt bar.
InsideTextOptionalStringThe task field to display inside the Gantt bar.
ResetOptionalBooleanTrue if the bar formatting is reset to the default formatting of the style in the Bar Styles dialog box; otherwise, False.
ProjectNameOptionalStringThe name of the project containing TaskID if consolidation is involved. The default value is the name of the active project.

Return Value

Boolean

Remarks

Using the GanttBarFormatEx method without specifying any arguments displays the Format Bar dialog box.

To define the default styles where colors can be hexadecimal RGB values, use the GanttBarEditEx method.

Example

The following example displays a medium red diamond shape for the start of the task with the Task ID of 3.

Sub GanttBar_Format() 

    'Activate Gantt Chart view 
    ViewApply Name:="&;Gantt Chart" 
    GanttBarFormatEx TaskID:=3, StartShape:=pjDiamond, StartType:=pjSolid, StartColor:=&;H8888FF
End Sub
© 2018 Microsoft