Application.BoxLinks method (Project)

Specifies the appearance of link lines in the active Network Diagram view.

Syntax

expression. BoxLinks( _Style_, _ShowArrows_, _ShowLabels_, _ColorMode_, _CriticalColor_, _NoncriticalColor_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Style Optional Long Specifies the style of link lines. Can be one of the following PjLinkStyle constants: pjLinkStraight or pjLinkRectilinear.
ShowArrows Optional Boolean True if link lines have arrows showing the direction of the link; otherwise, False.
ShowLabels Optional Boolean True if link lines have labels showing the link type (FS, SS, SF, or FF); otherwise, False.
ColorMode Optional Long Specifies how the color of link lines is determined. Can be one of the PjLinkColorMode constants.
CriticalColor Optional Long The color of link lines between critical tasks. The default value is pjRed. Can be one of the PjColor constants.
NoncriticalColor Optional Long The color of link lines between noncritical tasks. Can be one of the PjColor constants. The default value is pjBlack.

Return value

Boolean

Remarks

If no arguments are specified, the BoxLinks method has no effect. If ColorMode is pjColorModePredecessor, the NoncriticalColor and CriticalColor parameters are ignored.

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

Example

The following example shows link labels and then sets critical links to a purple color and noncritical links to a teal color.

Sub BoxLink_ChangeColor() 
 
 'Activate the Network Diagram view 
 ViewApply Name:="Network Diagram" 
 
 BoxLinks Style:=ShowLabels:=True, ColorMode:=pjColorModeCustom, _ 
 CriticalColor:=pjPurple, NoncriticalColor:=pjTeal 
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.