Article ID: 167240
Article Last Modified on 8/27/2007
167138 OL97: 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 combobox is on
Set objFormTab = Item.GetInspector.ModifiedFormPages("TabName")
' Set the object referring to the combobox
Set objCombo = objFormTab.Controls("ComboBox1")
' Loop through all of the contacts
For Each Contact in objAllContacts
' Add the current contact's fullname to the combobox
objCombo.AddItem Contact.FullName
Next
End Sub
Additional query words: OutSol OutSol97
Keywords: kbcode kbinfo kbprogramming KB167240