Application.BoxCellEdit method (Project)

Sets the properties of an individual cell in a data template for a Network Diagram view (PERT chart).

Syntax

expression. BoxCellEdit( _Name_, _Cell_, _FieldName_, _Font_, _FontSize_, _FontColor_, _Bold_, _Italic_, _Underline_, _HorizontalAlignment_, _VerticalAlignment_, _TextLineLimit_, _ShowLabel_, _Label_, _DateFormat_ )

expression A variable that represents 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 color of the font. Can be one of the PjColor constants.
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 BoxCellEdit method with only the Name and Cell arguments has no effect.

To edit a data template cell where the text color can be an RGB value, use the BoxCellEditEx method.

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 green color.

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

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.