Item Method Example

This example displays the name of the first document in the Documents collection.

If Documents.Count >= 1 Then
    MsgBox Documents.Item(1).Name
End If

This example selects the bookmark named "temp" in the active document.

If ActiveDocument.Bookmarks.Exists("temp") = True Then
    ActiveDocument.Bookmarks.Item("temp").Select
End If

This example adds two names to the MyNames collection. The Item method is used to return each of the items in the collection.

Dim MyNames As New Collection
MyNames.Add Item:="Dave Edson"
MyNames.Add Item:="Tim O'Brien"
MsgBox MyNames.Item(1) & vbCr & MyNames.Item(2)

This example clears all the items from the drop-down form field named "Colors" and then adds two color names. The Item method is used to display the first color in the drop-down form field.

With ActiveDocument.FormFields("Colors").DropDown.ListEntries
    .Clear
    .Add Name:="Blue"
    .Add Name:="Red"
    MsgBox .Item(1).Name
End With