PDA

View Full Version : Get contact details. Search criteria - Alias name in outlook



sagnik_pal
06-17-2010, 01:39 PM
=================
My Requirement:
=================
In exchange GAL, I have more than 600000 records.
Each employee has their unique employee ID in the Alias field in the GAL.

I have an excel where few Alias (employee IDs) are listed, say in "Sheet1" cell A2 & downwards.

I need the VBA code to select the sheet1, search the Alias in the GAL & provide details like First name, Last name, display name, email, Ph no etc in the same row.

& it has to be done in the fastest possible way.

===============================================
My Logic which I am planning to put into code:
===============================================
1) Open a MAPI connection import first 2000 contact details in an array
2) Search for each Alias in the array, if it matches then paste corresponding details for that Alias & continue with the remaining Alias
3) Get the next 2000 address & search for alias again, correspondingly fill up the data if alias name is available in the array. Skip the alias for which data has already been obtained.
4) Repeat Steps 3 till all Alias details are available or the 600000 contacts search expires

Question1> Is there any logic which can do this task in a faster way?

Question2> For a contact in GAL - does it save time if I store only the alias & email ID instead of Firstname, Lastname, Displayname, email, alias etc in an array.
I mean to ask, does VBA get all the fields of a contact from mail server in one go? So that it does not matter how many fields you store.
Or does it get data as you start putting each field in an array. So that lesser the number of fields you put in array, lesser time it takes to retreive data from mail server.

===========================
What I have done till now:
===========================
I am not aware of the syntax of VBA but can understand the basics by looking at the code

1) Searched for the code to get 2000 records in an array.


Dont know how to search for the alias in that array & return corresponding details for that alias.

Need help!!
Thanks in advance