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

Global Address List Entry ID problem for IMailUser



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 28th 07, 09:13 PM posted to microsoft.public.exchange.development,microsoft.public.outlook.program_vba
Stuart Bray
external usenet poster
 
Posts: 2
Default Global Address List Entry ID problem for IMailUser

Hi, I've got a problem I'm hoping someone can shed some light on.
We're fetching information about GAL users from a machine that does
*not* have Outlook installed. We use the Exchange System Manager
version of MAPI, since it has been recommended that Outlook not be
installed on server machines. The problem is that the Entry ID we
get from our server machine (with ESM MAPI) is not the same as the
EntryID we get from a machine with Outlook installed - it appears to
be much shorter, maybe because it's not cached? This ID cannot be
used to open the contact with IAddrBook:etails on any other machine
that has Outlook installed; it's returning MAPI_E_NOT_FOUND.

Anyone know a solution?

Here's how we're getting PR_ENTRYID on the machine with Exchange
System Manager installed:


SizedSPropTagArray(3, sptaAttributes) =
{
3,
{
PR_ENTRYID,
PR_RECORD_KEY,
PR_LAST_MODIFICATION_TIME
}
};

hr = m_pGAB-GetContentsTable(unicodeFlag, &lpContentTable);
if (HR_FAILED(hr))
{
return false;
}

hr = lpContentTable-SetColumns((LPSPropTagArray)&sptaAttributes, 0);
if (HR_FAILED(hr))
{
return false;
}

// Query 25 rows at a time
hr = lpContentTable-QueryRows(25, 0, &lpRows);
while(SUCCEEDED(hr))
{
for(ULONG index = 0; index lpRows-cRows; index++)
{
// setup the folder var's
CString strItemEID = "";

if(!IsErrorProp(lpRows-aRow[index].lpProps[0]))
{
strItemEID = CMapiUtil::Bin2Hex(
lpRows-aRow[index].lpProps[0].Value.bin.cb,
lpRows-aRow[index].lpProps[0].Value.bin.lpb
);
LOG_DEBUG(L"EID: %s", strItemEID);
}

.... and here's how we try to open this item, on a machine that has
Outlook installed:

hr := m_session.OpenAddressBook(0, PGUID(nil)^, AB_NO_DIALOG,
addrBook);
if (hr S_OK) or (addrBook = nil) then
begin
DoCleanup;
FatalError('TUIOutlookManipulator/ViewItem - OpenAddressBook
failed', hr, m_session);
exit;
end;

item.SetEntryIdFromString(eid);
handle := Cardinal(Application.Handle);
addrBook.Details(handle,
nil,
nil,
item.m_eidLength,
item.m_eid,
nil,
nil,
nil,
DIALOG_MODAL);


Any suggestions would be greatly appreciated!

Ads
  #2  
Old March 28th 07, 10:51 PM posted to microsoft.public.exchange.development,microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Global Address List Entry ID problem for IMailUser

Firstly, win32.programmer.messaging is a better newsgroup for the Extended
MAPI questions.
Secondly, most likely you are getting a short term entry id (which can only
be used in the current MAPI session) - try to use the entry id retrieved
from IMAPTable to open the corresponding IMailUser usingg
IAddrBook::OpenEntry, then retrieve PR_ENTRYID from the IMailUser usin
HrGetOneProp or IMailUser::GetProps.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Stuart Bray" wrote in message
oups.com...
Hi, I've got a problem I'm hoping someone can shed some light on.
We're fetching information about GAL users from a machine that does
*not* have Outlook installed. We use the Exchange System Manager
version of MAPI, since it has been recommended that Outlook not be
installed on server machines. The problem is that the Entry ID we
get from our server machine (with ESM MAPI) is not the same as the
EntryID we get from a machine with Outlook installed - it appears to
be much shorter, maybe because it's not cached? This ID cannot be
used to open the contact with IAddrBook:etails on any other machine
that has Outlook installed; it's returning MAPI_E_NOT_FOUND.

Anyone know a solution?

Here's how we're getting PR_ENTRYID on the machine with Exchange
System Manager installed:


SizedSPropTagArray(3, sptaAttributes) =
{
3,
{
PR_ENTRYID,
PR_RECORD_KEY,
PR_LAST_MODIFICATION_TIME
}
};

hr = m_pGAB-GetContentsTable(unicodeFlag, &lpContentTable);
if (HR_FAILED(hr))
{
return false;
}

hr = lpContentTable-SetColumns((LPSPropTagArray)&sptaAttributes, 0);
if (HR_FAILED(hr))
{
return false;
}

// Query 25 rows at a time
hr = lpContentTable-QueryRows(25, 0, &lpRows);
while(SUCCEEDED(hr))
{
for(ULONG index = 0; index lpRows-cRows; index++)
{
// setup the folder var's
CString strItemEID = "";

if(!IsErrorProp(lpRows-aRow[index].lpProps[0]))
{
strItemEID = CMapiUtil::Bin2Hex(
lpRows-aRow[index].lpProps[0].Value.bin.cb,
lpRows-aRow[index].lpProps[0].Value.bin.lpb
);
LOG_DEBUG(L"EID: %s", strItemEID);
}

... and here's how we try to open this item, on a machine that has
Outlook installed:

hr := m_session.OpenAddressBook(0, PGUID(nil)^, AB_NO_DIALOG,
addrBook);
if (hr S_OK) or (addrBook = nil) then
begin
DoCleanup;
FatalError('TUIOutlookManipulator/ViewItem - OpenAddressBook
failed', hr, m_session);
exit;
end;

item.SetEntryIdFromString(eid);
handle := Cardinal(Application.Handle);
addrBook.Details(handle,
nil,
nil,
item.m_eidLength,
item.m_eid,
nil,
nil,
nil,
DIALOG_MODAL);


Any suggestions would be greatly appreciated!



 




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
Getting "Department" from entry in Global Address List Kryer Outlook and VBA 4 October 17th 06 06:01 PM
Second entry in Global Address List SteveB Outlook - Using Contacts 0 October 11th 06 05:05 PM
How to print Global Address List, or export to Contacts List? Duane Outlook - Using Contacts 1 August 11th 06 02:51 AM
Extract email addresses from Distribution LIst in Global Address List tthomas Outlook and VBA 2 June 22nd 06 01:02 AM
global global address list FrankML Outlook - Using Contacts 1 March 7th 06 11:02 AM


All times are GMT +1. The time now is 09:11 AM.


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