IWbs.PasteBranch Method

Pastes a task or a branch from the internal clipboard.
Function PasteBranch( _ 
ByVal pasteAfterTask As ITask, _ 
ByVal pasteToNextLevel As Boolean
) As ITask
This language is not supported or no code example is available.
ITask PasteBranch( 
ITask pasteAfterTask
bool pasteToNextLevel 
)
This language is not supported or no code example is available.

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

ITask

The top task of the pasted branch.

Exception type Condition

QdvApiException

A problem occurred.

NotSupportedException

If this method is called from an external client.

Remarks
 

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.

Version
 
Available since QDV 7.13.489.

.NET Framework

Supported in: 4.8, 4.7, 4.6, 4.5.2

In this article

Definition