WebListBoxItems object (Publisher)

Represents the items in a web list box control.

Remarks

Use the ListBoxItems property of the WebListBox object to access the items in a web list box.

Use the AddItem method to add items to a web list box.

Example

This example creates a new web list box and adds several items to it. Note that when initially created, a web list box control contains three default items. This example includes a routine that deletes the default list box items before adding new items.

Sub CreateWebListBox() 
 Dim intCount As Integer 
 With ActiveDocument.Pages(1).Shapes 
 With .AddWebControl(Type:=pbWebControlListBox, Left:=100, _ 
 Top:=150, Width:=300, Height:=72).WebListBox 
 .MultiSelect = msoFalse 
 With .ListBoxItems 
 For intCount = 1 To .Count 
 .Delete (1) 
 Next 
 .AddItem Item:="Green" 
 .AddItem Item:="Purple" 
 .AddItem Item:="Red" 
 .AddItem Item:="Black" 
 End With 
 End With 
 End With 
End Sub

Methods

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.