![]() |
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
|
|||
|
|||
![]()
Greetings,
I would like the display names in an Outlook global address list to be available in a combo box on a form in MS Access. I have created a linked table to the Outlook Global Address list in the database, and am referencing the table in the form, but it operates at an unacceptably slow speed. I can select the names, but the autocomplete takes minutes find the name. Is there some way of retrieving these values from the Outlook object model programmatically so that it runs much faster? I would ultimately like for the user to be able to select a name from the list. Incidentally, I can retrive AddressEntries properties via the Outlook Object model, but I get the warning message each tim the code tried to retirve a proprty (i.e. name, etc.) Thanks in advance. DEI |
Ads |
#2
|
|||
|
|||
![]()
DEI wrote:
Greetings, I would like the display names in an Outlook global address list to be available in a combo box on a form in MS Access. I have created a linked table to the Outlook Global Address list in the database, and am referencing the table in the form, but it operates at an unacceptably slow speed. I can select the names, but the autocomplete takes minutes find the name. Is there some way of retrieving these values from the Outlook object model programmatically so that it runs much faster? I would ultimately like for the user to be able to select a name from the list. Incidentally, I can retrive AddressEntries properties via the Outlook Object model, but I get the warning message each tim the code tried to retirve a proprty (i.e. name, etc.) Thanks in advance. DEI When listboxes or combos get too complicated I suggest using a UDF (user defined function) rowtype instead of ValueList or Table/Query. Here's some code I provided to someone in the Access newsgroup to demonstrate how to make one. It scans all of the queries in the database and presents them in a listbox. Once you make a UDF rowtype you have the template for any others you need in the future. You can find an explanation of a combo/listbox UDF in help. In A97, the topic is "RowSourceType Property (User-Defined Function) — Code Argument Values" I dropped this code in the form's code module. Option Explicit Option Compare Database Private Type QueryList 'change the type name/column names to whatever you like. QueryName As Variant 'QueryDate as Date 'add any other columns associated with this type End Type Private Function FillQueryList(fld As Control, ID As Variant, row As Variant, col As Variant, Code As Variant) As Variant On Error Resume Next Static strRows() As QueryList Static Entries As Integer Dim qdf As QueryDef Dim ReturnVal As Variant ReturnVal = Null Select Case Code Case acLBInitialize ' Initialize. Entries = 0 ReDim Preserve strRows(Entries) 'creates header/column row. Useful if colheads is True strRows(Entries).QueryName = "Query Name" For Each qdf In CurrentDb.QueryDefs If Left(qdf.Name, 1) "~" Then Entries = Entries + 1 ReDim Preserve strRows(Entries) strRows(Entries).QueryName = qdf.Name End If Next qdf ReturnVal = True Case acLBOpen ' Open. ReturnVal = Timer ' Generate unique ID for control. Case acLBGetRowCount ' Get number of rows. ReturnVal = Entries + 1 Case acLBGetColumnCount ' Get number of columns. ReturnVal = 1 Case acLBGetColumnWidth ' Column width. ReturnVal = -1 ' -1 forces use of default width. Case acLBGetValue ' Get data. Select Case col Case 0 'this example has a single column. ReturnVal = strRows(row).QueryName 'Case 1...Case column cnt ' returnVal = strRows(row).theTypeRowName End Select Case acLBEnd ' End. Erase strRows End Select FillQueryList = ReturnVal End Function Now create a listbox, 1 column to display query name. In the Listbox's RowSourceType row (under Data tab) enter FillQueryList without a preceding "=" and then blank out the RowSource row. Save the form and run. In your case, you need to modify the code under the following statements. Case acLBInitialize ' Initialize. 'get the address list in order. Case acLBGetColumnCount ' Get number of columns. 'change the column count if necessary Case acLBGetValue ' Get data. 'fill in the column values. |
#3
|
|||
|
|||
![]()
In versions earlier than Office 2007 that's the Outlook security warnings
and they will be there for any code run from Access. To learn more about them and how to avoid them see http://www.outlookcode.com/article.aspx?id=52. A linked table will always be slower than object model access. You can use object model code to populate your control but I don't know whether that will speed up autocomplete. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "DEI" wrote in message ... Greetings, I would like the display names in an Outlook global address list to be available in a combo box on a form in MS Access. I have created a linked table to the Outlook Global Address list in the database, and am referencing the table in the form, but it operates at an unacceptably slow speed. I can select the names, but the autocomplete takes minutes find the name. Is there some way of retrieving these values from the Outlook object model programmatically so that it runs much faster? I would ultimately like for the user to be able to select a name from the list. Incidentally, I can retrive AddressEntries properties via the Outlook Object model, but I get the warning message each tim the code tried to retirve a proprty (i.e. name, etc.) Thanks in advance. DEI |
#4
|
|||
|
|||
![]()
Why do you want to retrieve *all* the GAL entries? Outlook never does that -
it only retrieves whatever is visible to the user (220-30 entries at a time). I would take another look at your design if I were you - more than a dozen entries in a combo box makes it unusable to an end user. Thousands of entries is certainly unacceptable. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "DEI" wrote in message ... Greetings, I would like the display names in an Outlook global address list to be available in a combo box on a form in MS Access. I have created a linked table to the Outlook Global Address list in the database, and am referencing the table in the form, but it operates at an unacceptably slow speed. I can select the names, but the autocomplete takes minutes find the name. Is there some way of retrieving these values from the Outlook object model programmatically so that it runs much faster? I would ultimately like for the user to be able to select a name from the list. Incidentally, I can retrive AddressEntries properties via the Outlook Object model, but I get the warning message each tim the code tried to retirve a proprty (i.e. name, etc.) Thanks in advance. DEI |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to link Contacts to Address Book | NP2 | Outlook - Using Contacts | 5 | November 11th 08 04:01 PM |
Address book really slow | Mom of 4 | Outlook Express | 1 | September 6th 08 07:23 PM |
Ladp address book look up too slow | awatiker | Outlook - Using Contacts | 0 | May 21st 06 06:30 PM |
Slow Address Book | Simon | Outlook - Using Contacts | 3 | January 20th 06 11:10 AM |