Application.BoxStylesEditEx method (Project)

Sets the style of boxes in the Network Diagram view, where colors can be hexadecimal values.

Syntax

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

expression An expression that returns 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 a hexadecimal value for the RGB color, where red is the last byte. For example, the value &HFF0000 is blue and &H00FFFF is yellow.
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 a hexadecimal value for the RGB color.
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.

Example

The following example changes boxes with the pjBoxCritical style to be shown as rounded rectangles, adds vertical gridlines, sets the border color to a dark red, and sets the background color to light gray with a dither pattern.

Sub BoxStyles_EditCritical() 
 'Activate the Network Diagram view 
 ViewApply Name:="Network Diagram" 
 
 BoxStylesEditEx Style:=pjBoxCritical, BorderShape:=pjBoxRoundedRectangle, VerticalGridlines:=True, _ 
 BorderColor:=&HB0, BorderWidth:=3, _ 
 BackgroundColor:=&HE0E0E0, BackgroundPattern:=pjBackgroundLightDither 
End Sub

Note

If you use any of the PjColor enumeration constants for the BorderColor or BackgroundColor parameters, the color will be nearly black. For example, the value of pjGreen is 9, which in the BoxLinksEx method is a very dark red. To use only the sixteen colors available with PjColor constants, use the BoxStylesEdit 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.