Application.BoxCellEditEx Method (Project)

Sets the properties of an individual cell in a data template for a Network Diagram view (PERT chart), where the font color can be specified with a hexadecimal value.

Version Information

Version Added: Project 2010

Syntax

expression .BoxCellEditEx(Name, Cell, FieldName, Font, FontSize, FontColor, Bold, Italic, Underline, HorizontalAlignment, VerticalAlignment, TextLineLimit, ShowLabel, Label, DateFormat)

expression An expression that returns an Application object.

Parameters

Name

Required/Optional

Data Type

Description

Name

Required

String

The name of the data template containing the cell to edit.

Cell

Required

Long

The cell to edit. Can be one of the PjCell constants.

FieldName

Optional

Long

The name of the field to display in the cell. Can be one of the PjField constants.

Font

Optional

String

The name of the font.

FontSize

Optional

Integer

The size of the font, in points.

FontColor

Optional

Long

The RGB 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.

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.

HorizontalAlignment

Optional

Long

Specifies the horizontal alignment of text in the cell. Can be one of the PjAlignment constants.

VerticalAlignment

Optional

Long

Specifies the horizontal alignment of text in the cell. Can be one of the PjVerticalAlignment constants.

TextLineLimit

Optional

Long

Specifies the limit for the number of lines of text in the cell. Values can be 1, 2, or 3.

ShowLabel

Optional

Boolean

True if a label is shown in the cell; otherwise, False.

Label

Optional

String

Specifies the cell label.

DateFormat

Optional

Long

Specifies the date format for the cell when FieldName is a date field. Can be one of the PjDateFormat constants.

Return Value

Boolean

Remarks

Using the BoxCellEditEx method with only the Name and Cell arguments has no effect.

Example

The following example modifies a copy of the Critical data template named Test Critical. The macro removes the fourth row of cells and sets the fourth cell in the third row to show the Actual Cost field and label in a purple-blue color.

Sub ModifyCriticalDataTemplate() 
 Application.BoxCellLayout Name:="Test Critical", CellRows:=3, MergeCells:=True 
 
 Application.BoxCellEditEx Name:="Test Critical", Cell:=pjCell4_3, _ 
 FieldName:=PjField.pjTaskActualCost, Font:="Arial", FontSize:="8", FontColor:=&HFF0077, _ 
 Bold:=False, Italic:=False, Underline:=False, HorizontalAlignment:=pjLeft, _ 
 VerticalAlignment:=pjMiddle, TextLineLimit:=1, ShowLabel:=True, Label:="Cost" 
End Sub

Note

If you use any of the PjColor enumeration constants for the FontColor parameter, the color will be nearly black. For example, the value of pjGreen is 9, which in the BoxCellEditEx method is a very dark red. To use only the sixteen colors available with PjColor constants, use the BoxCellEdit method.