Application.BoxStylesEdit method (Project)

Sets the style of boxes in the Network Diagram view.

Syntax

expression. BoxStylesEdit( _Style_, _DataTemplate_, _HorizontalGridlines_, _VerticalGridlines_, _BorderShape_, _BorderColor_, _BorderWidth_, _BackgroundColor_, _BackgroundPattern_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Style Required Long The box style to change. Can be one of the PjBoxStyle constants.
DataTemplate Optional String The name of the data template to use for the style.
HorizontalGridlines Optional Boolean True if horizontal gridlines separate each row in the box; otherwise, False.
VerticalGridlines Optional Boolean True if vertical gridlines separate each row in the box; otherwise, False.
BorderShape Optional Long The shape of the box border. Can be one of the PjBoxShape constants.
BorderColor Optional Long The color of the box border. Can be one of the PjColor constants.
BorderWidth Optional Long A value from 1 through 4 that specifies the width of the box border, in pixels.
BackgroundColor 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.

Return value

Boolean

Remarks

To display the Box Styles dialog box, use the BarBoxStyles method.

To edit box link lines where the colors can be RGB values, use the BoxStylesEditEx method.

Example

The following example changes boxes with the pjBoxCritical style to be shown as rounded rectangles, adds vertical gridlines, and sets the border and background colors.

Sub BoxStyles_Edit() 
 'Activate the Network Diagram view 
 ViewApply Name:="Network Diagram" 
 
 BoxStylesEdit Style:=pjBoxCritical, BorderShape:=pjBoxRoundedRectangle, VerticalGridlines:=True, _ 
 BorderColor:=pjRed, BorderWidth:=3, _ 
 BackgroundColor:=pjGray, BackgroundPattern:=pjBackgroundLightDither 
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.