Table of contents
Collapse the table of content
Expand the table of content

WebListBox.ListBoxItems Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

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


expression. ListBoxItems

_expression_A variable that represents a WebListBox object.

Return Value



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

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) 
 .AddItem Item:="Yellow" 
 .AddItem Item:="Red" 
 .AddItem Item:="Blue" 
 .AddItem Item:="Green" 
 .AddItem Item:="Black" 
 End With 
 End With 
End Sub
© 2018 Microsoft