CIMTranslationGroups.Item (read-only property)

Gets a CIMTranslationGroup object from the collection.
Syntax: Set object = object.Item ( IndexOrKey )
IndexOrKey As VARIANT* - This may be a string or a number. If it is a string this gets the the group with a Key value the same as the string. If it is a number it gets the group at the the index of the number. The numerical index a particular item is at is not related to insertion order, and may change as other items are inserted. Also, any particular order that is observed may change in future implimentaions of this object. If using a string the lookup is case sensitive, so "Hello" will get a different result than "HELLO".
Description: Retrieves the item that corresponds to IndexOrKey in the collection. This collection is not an array so if you need to iterate over the whole collection using a For Each Group In Groups loop will be more efficient than using the Item property.


Sub CIMTranslationGroups_Example()
    Dim oLangMap As CIMLangMapper.CIMLangMap
    Dim oTranslationGroup As CIMLangMapper.CIMTranslationGroup
    Dim oTranslationGroups As CIMLangMapper.CIMTranslationGroups
    Set oLangMap = CreateObject("CIMLangMapper.CIMLangMap")
    Set oTranslationGroup = oLangMap.AddTranslationGroup("Wheel bearing")
    Set oTranslationGroup = oLangMap.AddTranslationGroup("Bye")
    Set oTranslationGroup = oLangMap.AddTranslationGroup("Hello")
    Set oTranslationGroup = oLangMap.AddTranslationGroup("Paint Color")
    Set oTranslationGroups = oLangMap.TranslationGroups
    Set oTranslationGroup = oTranslationGroups.Item(0)
    If Not oTranslationGroup Is Nothing Then
      MsgBox oTranslationGroup.Key
    End If
    Set oTranslationGroup = oTranslationGroups.Item("Bye")
    If Not oTranslationGroup Is Nothing Then
      MsgBox oTranslationGroup.Key
    End If
End Sub