IWbs.PasteBranch Method
Parameters
- pasteAfterTask
- ITask
The task after which the task or branch from the clipboard is to be copied.
- pasteToNextLevel
- bool
If set to true, then the task or branch will be pasted on the next level (i.e. it will be a subtask of pasteAfterTask ); otherwise, the pasting will be done on the same level as pasteAfterTask.
Return Value
ITaskThe top task of the pasted branch.
Exception type | Condition |
---|---|
A problem occurred. |
|
If this method is called from an external client. |
Unlike other functions that create or delete tasks, this function automatically repaints WBS and minutes. You don't have to call IEstimate.CheckAndRepaint method after any change brought by the function. Nor you need to call the Refresh method, because the task tree is rebuilt automatically by this method. So in essence, this method is a shortcut for the following code:
Me.PasteBranchWithoutRefresh() Me.Version.Estimate.CheckAndRepaint() Me.Refresh()
Before calling this method, use the CopyBranch method to copy a task or a branch to the clipboard.
This method may be used only from macros, but not from external clients connected via InterfaceQDV.dll. If called from an external client, the NotSupportedException will be thrown.