![]() |
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
|
|||
|
|||
![]()
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: ![]() 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
|
|||
|
|||
![]()
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: ![]() 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 |
Display Modes | |
|
|
![]() |
||||
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 |