Specify Possible Values for a List Box

The following example fills a ListBox control with the values "Test1", "Test2", and "Test3" when you open the form.

Sub Item_Open() 
 
 ' Sets the name of page on the form, in this case, the 
 ' Message page on a MailItem form. 
 Set FormPage = Item.GetInspector.ModifiedFormPages("Message") 
 
 ' Sets Control to a list box called ListBox1. 
 Set Control = FormPage.Controls("ListBox1") 
 
 ' Assign values to the list box. 
 Control.PossibleValues = "Test1;Test2;Test3" 
 
End Sub

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.