Application.BoxFormat Method

Project Developer Reference

Formats individual boxes in the Network Diagram.

Syntax

expression.BoxFormat(ProjectName, TaskID, DataTemplate, HorizontalGridlines, VerticalGridlines, BorderShape, BorderColor, BorderWidth, BackgroundColor, BackgroundPattern, Reset)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
ProjectName Optional String The name of the project containing TaskID when working with consolidated projects. The default value is the name of the active project.
TaskID Optional Long The identification number of the task represented by the box to change. The default behavior is to change the box(es) representing the selected task(s).
DataTemplate Optional String The name of the data template to use.
HorizontalGridlines Optional Boolean True if horizontal gridlines separate each row in the box.
VerticalGridlines Optional Boolean True if vertical gridlines separate each row in the box.
BorderShape Optional Long The shape of the box border. Can be one of the PjBoxShape constants.
BorderColor Optional Long The color of the box background. Can be one of the PjColor constants.
BackgroundPattern Optional Long The pattern for the background. Can be one of the PjBackgroundPattern constants.
Reset Optional Boolean True if the box formatting is reset to the default style as shown in the Box Styles dialog box. If Reset is True, all arguments except ProjectName and TaskID are ignored.

Return Value
Boolean

Remarks

If TaskID is specified, the associated task cannot be hidden due to application of a filter or a collapsed outline structure.

Using the BoxFormat method without specifying any arguments displays the Format Box dialog box for the selected tasks. If no tasks are selected, the BoxFormat method has no effect.

Use the BoxFormat method to change the formatting of boxes from their default styles. To define the default styles, use the BoxStylesEdit method.

Example
The following example changes the border color to green and then to red.

Visual Basic for Applications
  Sub BoxFormat_Color()
	
    'Activate the Network Diagram view
    ViewApply Name:="Network Diagram"
    
   BoxFormat  TaskID:="3", BorderColor:=pjGreen
    BoxFormat TaskID:="3", BorderColor:=pjRed
End Sub

See Also