Share via


WebListBox.ListBoxItems Property

Publisher Developer Reference

Returns a WebListBoxItems object that represents the items in a Web list box control.

Syntax

expression.ListBoxItems

expression   A variable that represents a WebListBox object.

Return Value
WebListBoxItems

Example

This example creates a new Web list box control and adds five new list items to it.

Visual Basic for Applications
  Sub NewListBoxItems()
    Dim intCount As Integer
    With ActiveDocument.Pages(1).Shapes.AddWebControl _
            (Type:=pbWebControlListBox, Left:=100, _
            Top:=100, Width:=150, Height:=100).WebListBox
        .MultiSelect = msoTrue
        With .ListBoxItems
            For intCount = 1 To .Count
                .Delete (1)
            Next
            .AddItem Item:="Yellow"
            .AddItem Item:="Red"
            .AddItem Item:="Blue"
            .AddItem Item:="Green"
            .AddItem Item:="Black"
        End With
    End With
End Sub

See Also