Copy Code
|
|
---|---|
Private Function AddItemToList(ListName As String, ItemName As String) _ As CustomizationListNode 'Add a member to a list Dim oCustomization As Customization Dim myList As CustomizationList Dim listRoot As CustomizationListNode Dim newListItem As CustomizationListNode Dim CLists As CustomizationLists 'This routine adds a new value to a project list. 'It works both with the lists provided with Quality Center 'and with lists added by users. On Error GoTo AddItemToListErr Set oCustomization = tdc.Customization Set CLists = oCustomization.Lists Set myList = CLists.List(ListName) Set listRoot = myList.RootNode Set newListItem = listRoot.AddChild(ItemName) oCustomization.Commit Set AddItemToList = newListItem Exit Function AddItemToListErr: Set AddItemToList = Nothing End Function |