D
Dave
I'm really new to outlook and vbScript. Fortunately, not new to
programming.
I've created a new form ("Houses") which is based off of a contact
form.
In that form I have 8 fields of different Contacts. All of those
contacts ought to be in the contacts folder.
For Example, the form contains the fields "Buyer, Seller, Builder,
etc..."
I want to be able to select the name of a contact from a drop down
list of all contacts for each one and then automatically add those
names to the Contacts field in the form so that it will link to the
item automatically.
My problen is that when I auto populate the combo box, my list is out
of order and incomplete. Help me.
I've tried cut n pasting several peoples code.. this is what is
running now...
Sub Item_Open()
' Sets FormPage equal to the page ("General")
Set FormPage = Item.GetInspector.ModifiedFormPages("General")
' Sets Control to a ListBox called ComboBox1
Set Control = FormPage.Controls("ComboBox1")
' Assign values to the ComboBox from Outlook Contacts
' Sets an object for the application
Set olns = Application.Session
' Get the default Contacts folder
Set ConFolder = olns.GetDefaultFolder(10)
' Get the items in the folder
Set ConItems = ConFolder.Items
' Get the total items in the Contacts folder
NumItems = ConItems.Count
' Loop through the items in the Contacts folder,
' filling the array with data and keeping track
' of the number of contacts found.
NumContacts = 0
For I = 1 to NumItems
Set itm = ConItems(I)
Control.AddItem itm.FileAs
Next
End Sub
Again, this gives me an incomplete and out of order drop down list....
Any thoughts
programming.
I've created a new form ("Houses") which is based off of a contact
form.
In that form I have 8 fields of different Contacts. All of those
contacts ought to be in the contacts folder.
For Example, the form contains the fields "Buyer, Seller, Builder,
etc..."
I want to be able to select the name of a contact from a drop down
list of all contacts for each one and then automatically add those
names to the Contacts field in the form so that it will link to the
item automatically.
My problen is that when I auto populate the combo box, my list is out
of order and incomplete. Help me.
I've tried cut n pasting several peoples code.. this is what is
running now...
Sub Item_Open()
' Sets FormPage equal to the page ("General")
Set FormPage = Item.GetInspector.ModifiedFormPages("General")
' Sets Control to a ListBox called ComboBox1
Set Control = FormPage.Controls("ComboBox1")
' Assign values to the ComboBox from Outlook Contacts
' Sets an object for the application
Set olns = Application.Session
' Get the default Contacts folder
Set ConFolder = olns.GetDefaultFolder(10)
' Get the items in the folder
Set ConItems = ConFolder.Items
' Get the total items in the Contacts folder
NumItems = ConItems.Count
' Loop through the items in the Contacts folder,
' filling the array with data and keeping track
' of the number of contacts found.
NumContacts = 0
For I = 1 to NumItems
Set itm = ConItems(I)
Control.AddItem itm.FileAs
Next
End Sub
Again, this gives me an incomplete and out of order drop down list....
Any thoughts