Share via


Application.BoxSet Method

Project Developer Reference

Creates, selects, or moves a task on the Network Diagram.

Syntax

expression.BoxSet(Action, TaskID, XPosition, YPosition, ProjectName)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Action Optional Long The operation to perform on the specified task(s). The default value is pjBoxSelect. Can be one of the PjBoxSet constants.
TaskID Optional Long The identification number of the task. If Action is pjBoxCreate, TaskID is ignored.
XPosition Optional Long The horizontal position of the task, in pixels. Required if Action is pjBoxMoveAbsolute or pjBoxMoveRelative. If Action is pjBoxCreate or pjBoxMoveAbsolute, XPosition is the absolute horizontal position of the upper-left corner of the task. If Action is pjBoxMoveRelative, XPosition is the amount to move the task horizontally relative to the current position. If Action is pjBoxAddToSelection, pjBoxSelect, or pjBoxUnselect, XPosition is ignored
YPosition Optional Long The vertical position of the task, in pixels. Required if Action is pjBoxMoveAbsolute or pjBoxMoveRelative. If Action is pjBoxCreate or pjBoxMoveAbsolute, YPosition is the absolute vertical position of the upper-left corner of the task. If Action is pjBoxMoveRelative, YPosition is the amount to move the task vertically relative to the current position. If Action is pjBoxAddToSelection, pjBoxSelect, or pjBoxUnselect, YPosition is ignored.
ProjectName Optional String If the active project is a consolidated project, specifies the name of the project for the identification number specified by TaskID. If TaskID is not specified, ProjectName is ignored. The default value is the name of the active project.

Return Value
Boolean

Remarks

If only one task box is selected, specifying pjBoxUnselect has no effect.

If automatic layout has been activated for the Network Diagram view, XPosition and YPosition have no effect.

Example
The following example adds the task with TaskID 2 to the selected tasks.

Visual Basic for Applications
  Sub Box_Set()
 
    'Activate the Network Diagram view        
    ViewApply Name:="Network Diagram"
    BoxSet Action:=pjBoxAddToSelection, TaskID:="2"
End Sub

See Also