|
我在文档中看到这么一段,不知有没有帮助。
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 QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
qtApp.TDConnection.Connect "http://qcserver/qcbin", _
"MY_DOMAIN", "My_Project", "James", "not4you", False ' Connect to Quality Center
If qtApp.TDConnection.IsConnected Then ' If connection is successful
qtApp.OpenBusinessComponent "[QualityCenter] Components\MyFolder\MyBC", False ' Open the business component
MsgBox qtApp.CurrentDocumentType 'Confirm that the open document is a business component
End If |
|