Article ID: 180911
Article Last Modified on 11/23/2006
182446 OL98: General Information About Using VBScript with Outlook
Sub Item_Open
' Set the NameSpace object.
Set objOLNS = Application.GetNameSpace("MAPI")
' Set the Contacts folder, which is in the MAPI NameSpace.
Set objContactFolder = objOLNS.GetDefaultFolder(10)
' Set the collection of all Contact items.
Set objAllContacts = objContactFolder.Items
' Set the object referring to the form page the combo box is on.
Set objFormTab = Item.GetInspector.ModifiedFormPages("TabName")
' Set the object referring to the combo box.
Set objCombo = objFormTab.Controls("ComboBox1")
' Loop through all of the contacts.
For Each Contact in objAllContacts
' Add the current contact's full name to the combo box.
objCombo.AddItem Contact.FullName
Next
End Sub
Additional query words: OutSol OutSol98 higher listbox list box
Keywords: kbcode kbhowto kbprogramming KB180911