P
Pbeast
Trying to populate a text box when a user selects a
contact from a combo box in a custom appointment form.
This combo box is filled with contacts by last name
'OL 2000
Function Item_Open()
'POPULATES A COMBO BOX WITH THE CONTACTS
'IN THE PERSONAL CONTACT FOLDER
Const olFolderContacts = 10
On Error Resume Next
'GETS THE FOLDER FOR CONTACTS IN THE OUTLOOK FOLDER TREE
Set MyContacts = Application.GetNameSpace("MAPI").Folders
("Specials Beta Project").Folders("Business Contacts")
Set MyItems = MyContacts.Items
Set RestrictedContactItems = MyItems.Restrict
("[Email1Address] <> ''")
'Sort by LastName in ascending order
RestrictedContactItems.Sort "[LastName]"
For Each MyItem in RestrictedContactItems
'RETRIEVES THE FILEAS PROPERTY FROM THE
'FILLED OUT CONTACT FORM
Item.GetInspector.ModifiedFormPages ("P.2").Controls
("cmbContacts").AddItem MyItem.FileAs
'cmbContacts is the combo box being filled
Next
IsLoading = True
cmbContacts.ListIndex = 0
IsLoading = False
End Function
'WHEN THE USER SELECTS THE CONTACT FROM THE COMBO BOX
'I WANT IT TO AUTOMATICALLY FILL IN A TEXT BOX WITH THAT
'INFORMATION
Sub cmbContacts_Click() 'WHEN USER SELECTS CONTACT
'????THIS SHOULD FILL IN THE FIELDS
'IN THE APPOINTMENT FORM
'HERE IS WHERE I NEED THE HELP
End Sub
contact from a combo box in a custom appointment form.
This combo box is filled with contacts by last name
'OL 2000
Function Item_Open()
'POPULATES A COMBO BOX WITH THE CONTACTS
'IN THE PERSONAL CONTACT FOLDER
Const olFolderContacts = 10
On Error Resume Next
'GETS THE FOLDER FOR CONTACTS IN THE OUTLOOK FOLDER TREE
Set MyContacts = Application.GetNameSpace("MAPI").Folders
("Specials Beta Project").Folders("Business Contacts")
Set MyItems = MyContacts.Items
Set RestrictedContactItems = MyItems.Restrict
("[Email1Address] <> ''")
'Sort by LastName in ascending order
RestrictedContactItems.Sort "[LastName]"
For Each MyItem in RestrictedContactItems
'RETRIEVES THE FILEAS PROPERTY FROM THE
'FILLED OUT CONTACT FORM
Item.GetInspector.ModifiedFormPages ("P.2").Controls
("cmbContacts").AddItem MyItem.FileAs
'cmbContacts is the combo box being filled
Next
IsLoading = True
cmbContacts.ListIndex = 0
IsLoading = False
End Function
'WHEN THE USER SELECTS THE CONTACT FROM THE COMBO BOX
'I WANT IT TO AUTOMATICALLY FILL IN A TEXT BOX WITH THAT
'INFORMATION
Sub cmbContacts_Click() 'WHEN USER SELECTS CONTACT
'????THIS SHOULD FILL IN THE FIELDS
'IN THE APPOINTMENT FORM
'HERE IS WHERE I NEED THE HELP
End Sub