Adds a Predecessor object to the Predecessors collection.
Syntax:
Object.Predecessors.Add(PredecessorKey As String, [PredecessorType As E_OBJECTTYPE = 0], [Key As String = ""], [StyleIndex As String = ""])
The Add Method (Predecessors Collection) syntax has these parts:
| Part |
Description |
| Object.Predecessors |
An object expression that evaluates to a Predecessors collection. |
| PredecessorKey |
Specifies the Key of the GanntItem or Milestone object that you want to link to this predecessor object. |
| PredecessorType |
Specifies the type of object that this Predecessor object is linking to as described in settings. |
| Key |
(Optional). A string value that uniquely identifies the Predecessor object. |
| StyleIndex |
(Optional). A string value that specifies the index or key of the Style object associated with the Predecessor object. |
The settings for PredecessorType are:
| Setting |
Description |
| 0 |
The Predecessor object is linking to a GanttItem object. |
| 1 |
The Predecessor object is linking to a Milestone object. |
Remarks:
This method adds objects at the top of the list. In order to retrieve the index of the Predecessor object that was added use the collection's Count property.
See Also:
Object Model And Anatomy of an ActiveGantt , Predecessors Property