I am trying to retreive QC user's email from QC using OTA API and VbScript but unsuccessful. OTA API help has some code in VBA but I am unsure how to re-code in VBS. Please help
VBA code from the help to retrieve 5 user's names and email address.
Dim custUsers As CustomizationUsersDim usr As CustomizationUserDim UList As List
Set custUsers = tdc.Customization.Users
Set UList = custUsers.UsersDebug.Print UList.Count
Dim maxU%, uCnt%
maxU = 5
For Each usr In UListuCnt = uCnt + 1With usrDebug.Print .name & ", " & .EmailEnd WithIf uCnt > maxU Then Exit ForNext usr
Exit SubErrorHandler:ErrHandler errEnd Sub
Go to Solution.
Hi kasukur ,
I am able to get the user's mail id with the below code, I have removed "With" function.
I am not sure why the (With function ) is not working.
Set QCConnection = CreateObject("TDApiOle80.TDConnection")
QCConnection.InitConnectionEx "almserver" '<-- Change me.QCConnection.Login "username", "password"QCConnection.Connect "Domain", "ProjectName"
Dim custUsersDim usrDim UList
Set custUsers = QCConnection.Customization.Users
For Each usr In UListuCnt = uCnt + 1MsgBox usr.NameMsgBox usr.EmailIf uCnt > maxU Then Exit ForNext usr