![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
This is the first time I have tried writing code or script of any sort so I need all the help I can get!
I have a 2 column combobox which I have gotten to display all of my outlook contact's full name and organisation id number successfully. However I cannot select a contact from the combobox and autocomplete doesn't work. Is this is because I need to assign a value? I have made a field in the properties tab of the combobox called Specifiers2 if that helps with setting the value. All of the scripts I have found don't work and I've been Googling for days now. Here is my code which is located in Outlook's Script Editor: Sub Item_Open() Dim FullArray() ' Sets the name of page on the form (Activity Sheet) Set FormPage = Item.GetInspector.ModifiedFormPages("Activity Sheet") ' Sets Control to a list box called ComboBox1. Set Control = FormPage.Controls("ComboBox1") ' Get the default Contacts folder Set ConFolder1 = Application.Session.GetDefaultFolder(10) Set ConFolder2 = ConFolder1.Folders("Nswlist") ' Get the items in the folder Set ConItems = ConFolder2.Items ' Get the number of total items in the Contacts folder NumItems = ConItems.Count ' Resize array to handle total number of item in the folder ReDim FullArray(NumItems-1,2) ' Loop through all of the items in the Contacts folder, ' filling the array with sample data and keeping track ' of the number of contacts found. NumContacts = 0 For I = 1 to NumItems Set itm = ConItems(I) If Left(itm.MessageClass, 11) = "IPM.Contact" Then NumContacts = NumContacts + 1 FullArray(NumContacts-1,1) = itm.CompanyName FullArray(NumContacts-1,2) = itm.OrganizationalIDNumber End If Next ' Set the control to handle 2 data columns Control.ColumnCount = 3 If NumItems = NumContacts Then ' They are all contacts, so use the FullArray Control.List() = FullArray Else ' There's some distribution lists, so use the smaller ' ConArray to eliminate extra blank values in the list box Dim ConArray() ReDim ConArray(NumContacts-1,2) For I = 0 to NumContacts - 1 ConArray(I,1) = FullArray(I,1) ConArray(I,2) = FullArray(I,2) Next Control.List() = ConArray End If End Sub |
Ads |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
auto correct option under proof reading is not available to select | Pattigal | Outlook - Installation | 1 | April 14th 10 04:40 PM |
Can you select more than one option in a drop down list in BCM? | Meb0017 | Outlook - General Queries | 1 | August 24th 09 02:51 PM |
select ALL option | Ranjit kurian | Outlook and VBA | 2 | September 22nd 08 07:24 PM |
How do I vote on a blackberry (select approve/reject option)? | voter | Outlook - Using Forms | 0 | October 18th 06 10:27 PM |
No option to select ACT address book. | MelissaKinVA | Outlook - Installation | 1 | March 8th 06 06:27 PM |