![]() |
| 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. |
|
|||||||
| Tags: alias, details, exchange, gal, getting, person |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello, I have an alias of a person listed in GAL (on Exchange server)
and I would like to obtain programatically its details, like email, name etc. The alias is stored as the value of field "Item12" but it always returns an error E_ACCESSDENIED. Is there a way how to do it? Set objSession = CreateObject("MAPI.Session") objSession.Logon (g_strMAPILogOn) Set MyAddressList = objSession.AddressLists(g_strAddressList) Set MyAddressEntries = MyAddressList.AddressEntries For Each SomeEntry In MyAddressEntries Set MyEntry = SomeEntry If alias = MyEntry.Fields("Item 12").Value Then ... ... End If Next Thank you, Petr |
| Ads |
|
#2
|
|||
|
|||
|
If someone has same problem I found a solution (almost everything was
already answered in this newsgroup). Thanks to everyone. Type Ohlasovatel jmeno As String email As String End Type Public Function GetOhlasovatelDetails(ByVal alias As String) As Ohlasovatel Dim objSession As MAPI.Session Dim objField As MAPI.Field Dim MyAddressList As MAPI.AddressList Dim MyAddressEntries As MAPI.AddressEntries Dim MyEntry As MAPI.AddressEntry Dim SomeEntry As MAPI.AddressEntry Dim MyRecipient As MAPI.Recipient Dim v As Variant Dim strReturnValue As String Dim jjmeno As String Dim eemail As String Set objSession = CreateObject("MAPI.Session") objSession.Logon (g_strMAPILogOn) Set MyAddressList = objSession.AddressLists(g_strAddressList) Set MyAddressEntries = MyAddressList.AddressEntries For Each SomeEntry In MyAddressEntries Set MyEntry = SomeEntry Set objField = MyEntry.Fields(CdoPR_EMS_AB_PROXY_ADDRESSES) If MyEntry.Fields(CdoPR_ACCOUNT) = alias Then jjmeno = MyEntry.Name For Each v In objField.Value If InStr(1, UCase(v), g_strEMailAddressIdentifier) Then eemail = Mid(v, 6, 256) GetOhlasovatelDetails.jmeno = jjmeno GetOhlasovatelDetails.email = eemail Exit Function End If Next 'Field Value End If Next 'Address Entry End Function Petr Bazant napsal: Hello, I have an alias of a person listed in GAL (on Exchange server) and I would like to obtain programatically its details, like email, name etc. The alias is stored as the value of field "Item12" but it always returns an error E_ACCESSDENIED. Is there a way how to do it? Set objSession = CreateObject("MAPI.Session") objSession.Logon (g_strMAPILogOn) Set MyAddressList = objSession.AddressLists(g_strAddressList) Set MyAddressEntries = MyAddressList.AddressEntries For Each SomeEntry In MyAddressEntries Set MyEntry = SomeEntry If alias = MyEntry.Fields("Item 12").Value Then ... ... End If Next Thank you, Petr |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can meeting requests only come from same GAL or Exchange Server | DallyLab | Outlook - Calandaring | 3 | February 22nd 07 10:03 PM |
| Allow users to maintain contact details in GAL | DI-Tex | Outlook - Using Contacts | 1 | October 18th 06 03:46 PM |
| Outlook contacts to Exchange GAL | Sam Giraffe | Outlook - Using Contacts | 0 | August 28th 06 07:24 PM |
| In Exchange calendar show name of person who scheduled meeting | Barbsboys2 | Outlook - Calandaring | 3 | February 18th 06 08:51 PM |
| Exchange GAL in Outlook using POP3 | Rich In NC | Outlook - Using Contacts | 1 | February 8th 06 04:56 AM |