A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Link To Outlook Address Book Slow



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 11th 08, 08:32 PM posted to microsoft.public.outlook.program_vba
DEI
external usenet poster
 
Posts: 1
Default Link To Outlook Address Book Slow

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  
Old November 11th 08, 09:00 PM posted to microsoft.public.outlook.program_vba
salad
external usenet poster
 
Posts: 27
Default Link To Outlook Address Book Slow

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  
Old November 12th 08, 03:26 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Link To Outlook Address Book Slow

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  
Old November 12th 08, 04:41 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Link To Outlook Address Book Slow

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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 06:23 PM
Ladp address book look up too slow awatiker Outlook - Using Contacts 0 May 21st 06 05:30 PM
Slow Address Book Simon Outlook - Using Contacts 3 January 20th 06 11:10 AM


All times are GMT +1. The time now is 02:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.