IVersionCol::Remove
See Also
Removes an object version from the collection.
HRESULT Remove(
VARIANT sItem
);
Parameters
sItem
[in]
Identifies the item to be removed from the collection. This parameter can be the index, the object identifier, or the Object-Version identifier of the item.
Return Value
S_OK
The method completed successfully.
Error
Values
This method failed to complete successfully.
Remarks
There are many different kinds of Object-Version collections. You can apply this method to some of them, but not to others. This method works for:
-
Target-Versions collections. You can use this method to reduce the set of versions of a particular target object that are related to a particular source object.
-
Versions-of-Workspace collections. You can use this method to remove an object version from the set of items contained in the workspace.
This method fails for:
-
Predecessor-Versions collections. To enlarge an object version’s set of predecessors, use MergeVersion.
-
Successor-Versions collections. To enlarge an object version’s set of successors, use the CreateVersion method of the IRepositoryObjectVersion interface.
-
Versions-of-Object collections. To enlarge an object’s set of versions, use the CreateVersion method of the IRepositoryObjectVersion interface.
-
Workspaces-of-Version collections. To remove a workspace from the set of workspaces in which an Object Version is present, you must explicitly remove the object version from that workspace’s Versions-of-Workspace collection.
-
Checkouts-of-Workspace collections. To reduce the number of items checked out to a workspace, use the Checkin method of the IWorkspaceItem interface.
The sItem parameter can be an object identifier for some version collections, but not for others. It can be an object identifier only for the Versions-of-Workspace collection, the Workspaces-of-Version collection, or the Checkouts-of-Workspace collection.