Application.BoxLinksEx method (Project)

Specifies the appearance of link lines in the active Network Diagram view, where colors can be hexadecimal values.

Syntax

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

expression An expression that returns 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. 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. The default value is 0, which does not change the previous color.
NoncriticalColor Optional Long The color of link lines between noncritical tasks. Can be a hexadecimal value; the default value is 0, which does not change the previous color.

Return value

Boolean

Remarks

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

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" 
 
    BoxLinksEx Style:=pjLinkRectilinear, ShowArrows:=True, ShowLabels:=True, ColorMode:=pjColorModeCustom, _ 
        CriticalColor:=&HBB00BB, noncriticalcolor:=&H999900 
End Sub

Note

If you use any of the PjColor enumeration constants for the CriticalColor or NoncriticalColor 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 BoxLinks 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.