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.

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.

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.