Create a New Business Component
Source code
' This example finds the list of associated add-ins for a specific Business Process Test.
' Then it creates a new business component and associates the same add-ins as those
' associated with the BPT.

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim arrBCAddins ' Declare the variable for storing the component's associated add-ins
Dim blnNeedChangeAddins ' Declare a flag for indicating whether the component's associated add-ins are currently loaded

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start UFT
qtApp.Visible = True ' Make the UFT application visible

qtApp.TDConnection.Connect "http://qcserver/qcbin", _
              "MY_DOMAIN", "My_Project", "James", "not4you", False ' Connect to ALM

If qtApp.TDConnection.IsConnected Then ' If connection is successful

'Find the add-ins associated with a business process test, and associate the same list
'with a new business component.
    arrBCAddins = qtApp.GetAssociatedAddinsForBPT("[QualityCenter] Subject\MyFolder\MyBPT")
    qtApp.BusinessComponent.SetAssociatedAddins arrBCAddins

End If