Re: What is next step to extracting PST contact items
- From: "Stephen Griffin [MSFT]" <sgriffin@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 21 Apr 2006 10:02:17 -0400
And there's the problem. IMO mode doesn't really support Extended MAPI. A
lot of stuff kinda works, but even more fails spectacularly. You need to run
in Corporate Workgroup mode to get Extended MAPI support.
We cut IMO mode in Outlook 2002.
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in message
news:usqR$ISZGHA.3480@xxxxxxxxxxxxxxxxxxxxxxx
Outlook 2000 - Help About says:
Outlook 2000 SR-1 (9.0.0.3821)
Internet Mail Only
"Dmitry Streblechenko" <dmitry@xxxxxxxxxxx> wrote in message
news:#J2V7gMZGHA.5004@xxxxxxxxxxxxxxxxxxxxxxx
What is your version of Outlook?One
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in message
news:e2v8CMMZGHA.3400@xxxxxxxxxxxxxxxxxxxxxxx
I don't understand what you mean when you say 'Can I open all PST store?
When I MAPILogonEx with MAPI_LOGON_UI I see two profiles to login to.
Internetjust says 'Microsoft Outlook'. The other says 'Microsoft Outlook
ISettings' -
If I choose 'Microsoft Outlook Internet Settings' as profile to logon
to
toget 0x8004010f and: An unexpected error has occurred. MAPI was unable
correctlyload the information service PSTPRX.DLL. Be sure the service is
makeinstalled and configured.
If I choose 'Microsoft Outlook' I get: An unexpected error has
occurred.
MAPI was unable to load the information service mspst.dll. Be sure the
service is correctly installed and configured.
Help me.......
When I run Outlook (ie without code!) I am not prompted to login - just
goes
into Outlook.
Angus
"Dmitry Streblechenko" <dmitry@xxxxxxxxxxx> wrote in message
news:#UWYApLZGHA.3328@xxxxxxxxxxxxxxxxxxxxxxx
The error is MAPI_E_NOT_FOUND.
Can you open *all* PST store when you log to that profile with
Outlook?
Did you try to add MAPI_EXPLICIT_PROFILE when calling MAPILogonEx to
State/Provincesure you log to the expected profile?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in message
news:u6mBneLZGHA.4884@xxxxxxxxxxxxxxxxxxxxxxx
Been playing around and now using this code:
But OpenMsgStore returns 0x8004010f
Here is slightly updated code:
const int ieidMax = 28;
static const SizedSPropTagArray(ieidMax, ptaEid)=
{
ieidMax,
{
PR_ENTRYID, // Non Text
PR_DISPLAY_NAME, // Name tab, Display field
PR_EMAIL_ADDRESS, // Name tab, Email addresses
PR_DISPLAY_NAME_PREFIX, // Name tab, Title
PR_GIVEN_NAME, // Name Tab, First (name) field
PR_MIDDLE_NAME, // Name tab, Middle (ie like initials)
PR_SURNAME, // Name tab, Surname
PR_NICKNAME, // Name tab, Nickname
PR_HOME_ADDRESS_STREET, // Home tab, Street Address (8)
PR_HOME_ADDRESS_CITY, // Home tab, City (9)
PR_HOME_ADDRESS_STATE_OR_PROVINCE, // Home tab, State/Province (10)
PR_HOME_ADDRESS_POSTAL_CODE, // Home tab, Zipcode (11)
PR_HOME_ADDRESS_COUNTRY, // Home tab, Country/Region (12)
PR_HOME_TELEPHONE_NUMBER, // Home tab, Phone (13)
PR_PERSONAL_HOME_PAGE, // Home tab, Web page (14)
PR_HOME_FAX_NUMBER, // Home tab, Fax (15)
PR_MOBILE_TELEPHONE_NUMBER, // Home tab, Mobile (16)
PR_COMPANY_NAME, // Business tab, Company (17)
PR_BUSINESS_ADDRESS_STREET, // Business tab, Street Address (18)
PR_BUSINESS_ADDRESS_CITY, // Business tab, City (19)
PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE, // Business tab,
to(20)
PR_BUSINESS_ADDRESS_POSTAL_CODE, // Business tab, Zip Code (21)
PR_BUSINESS_ADDRESS_COUNTRY, // Business tab, Country (22)
PR_BUSINESS_TELEPHONE_NUMBER, // Business tab, Phone (23)
PR_BUSINESS_HOME_PAGE, // Business tab, Web Page (24)
PR_BUSINESS_FAX_NUMBER, // Business tab, Fax (25)
PR_TITLE, // Business tab, Job Title (26)
PR_COMMENT, // Other tab, Notes (27)
}
};
if (MAPIInitialize(0) == S_OK)
printf("MAPI initialised\n");
char szError[256];
ULONG ulFlags = 0;
ulFlags = ulFlags | MAPI_LOGON_UI | MAPI_NO_MAIL | MAPI_EXTENDED;
LPMAPISESSION pSession = NULL;
HRESULT hr = MAPILogonEx(0, 0, 0, ulFlags, &pSession);
SCODE sc = S_OK;
LPMAPITABLE pMAPITable = NULL;
hr = pSession->GetMsgStoresTable(0, &pMAPITable); // only flag seems
fieldsbe
informationMAPI_UNICODE
// Set columns we want
hr = pMAPITable->SetColumns((LPSPropTagArray)&ptaEid, 0 );
SRowSet* pSRowSet = NULL;
hr = pMAPITable->QueryRows(5, 0, &pSRowSet);
IMsgStore* pStore = NULL;
hr = pSession->OpenMsgStore(0,
pSRowSet->aRow[0].lpProps[0].Value.bin.cb,
(ENTRYID *)pSRowSet->aRow[0].lpProps[0].Value.bin.lpb,
NULL, 0, &pStore);
MAPIERROR* pMapiError = NULL;
pSession->GetLastError(hr, 0, &pMapiError);
error description is now
An unexpected error has occurred. MAPI was unable to load the
contactsservice PSTPRX.DLL. Be sure the service is correctly installed and
configured.
And interestingly I think things worked better when I selected
Microsoft
Outlook (rather than eg Outlook Express) as default email in IE
Tools...
Internet Options... Programs.
The struct was something I re-used from some code which extracts
from the Windows Address Book (which works). Maybe some of the
seemsare
arrive!!!incorrect? Or are fields same for Outlook pst and WAB?
Yours appreciatively.
Angus
"Dmitry Streblechenko" <dmitry@xxxxxxxxxxx> wrote in message
news:uuCJ9YKZGHA.1352@xxxxxxxxxxxxxxxxxxxxxxx
What was the numeric error valuee returned by
pSession->OpenMsgStore()?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in message
news:OtViqzIZGHA.3328@xxxxxxxxxxxxxxxxxxxxxxx
OK ... I am learning - still waiting for my Inside MAPI CD to
LPTSTRHope it makes sense of MAPI for me.
Anyway, here is my code now:
if (MAPIInitialize(0) == S_OK)
printf("MAPI initialised\n");
char szError[256];
// HRESULT MAPILogonEx(ULONG ulUIParam, LPTSTR lpszProfileName,
lpszPassword, FLAGS flFlags,
// LPMAPISESSION FAR * lppSession)
ULONG ulFlags = 0;
ulFlags = ulFlags | MAPI_LOGON_UI | MAPI_NO_MAIL | MAPI_EXTENDED;
LPMAPISESSION pSession = NULL;
// HRESULT hr = MAPILogonEx(0, 0, 0, MAPI_USE_DEFAULT |
MAPI_EXPLICIT_PROFILE, &pSession);
HRESULT hr = MAPILogonEx(0, 0, 0, ulFlags, &pSession);
SCODE sc = S_OK;
LPMAPITABLE pMAPITable = NULL;
hr = pSession->GetMsgStoresTable(0, &pMAPITable); // only flag
flagto
IMAPITable::SetColumns()be
informationMAPI_UNICODE
// Columns in contents table.
//Used to filter the columns for enumerating emails using MAPI
SizedSPropTagArray ( 2, rgPropTag ) =
{
2,
{
PR_ENTRYID, // its unique across directory
PR_DISPLAY_NAME
}
};
// Set columns we want
hr = pMAPITable->SetColumns((LPSPropTagArray)&rgPropTag, 0 );
SRowSet* pSRowSet = NULL;
hr = pMAPITable->QueryRows(1, 0, &pSRowSet);
IMsgStore* pStore = NULL;
hr = pSession->OpenMsgStore(0,
pSRowSet->aRow[0].lpProps[0].Value.bin.cb,
(ENTRYID *)pSRowSet->aRow[0].lpProps[0].Value.bin.lpb,
NULL,
0,
&pStore);
// can use HR_FAILED to check hr value
MAPIERROR* pMapiError = NULL;
pSession->GetLastError(hr, 0, &pMapiError);
But I get this error description now:
An unexpected error has occurred. MAPI was unable to load the
developmentservice mspst.dll. Be sure the service is correctly installed and
configured.
Any ideas what's wrong now?
Error on OpenMsgStore function. Is this correct function? My
machine has a few contacts in the Contacts folder in Outlook.
Not
using
Exchange Server. Outlook opens up fine.
Angus
"Dmitry Streblechenko" <dmitry@xxxxxxxxxxx> wrote in message
news:uoEVD9mYGHA.1764@xxxxxxxxxxxxxxxxxxxxxxx
0x8004010F is MAPI_E_NOT_FOUND. Did you call
andspecifying the PR_ENTRYID property before you call QueryRows()?information
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in message
news:Ozp1x2mYGHA.2136@xxxxxxxxxxxxxxxxxxxxxxx
The error is:
An unexpected error has occurred. MAPI was unable to load the
service PSTPRX.DLL. Be sure the service is correctly
installed
ableaccount -configured.
Now I have setup Outlook without email - ie there is no email
only
using Contacts. Is this the problem? Surely I should still
be
to
messagestore?get
the Contacts? Or are these functions only getting the email
Angus
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in message
news:O2x73xmYGHA.460@xxxxxxxxxxxxxxxxxxxxxxx
I am now trying this:
LPMAPITABLE pMAPITable = NULL;
hr = pSession->GetMsgStoresTable(0, &pMAPITable); // only
flag
seems
to
be
MAPI_UNICODE
SRowSet* pSRowSet = NULL;
hr = pMAPITable->QueryRows(1, 0, &pSRowSet);
IMsgStore* pStore = NULL;
hr = pSession->OpenMsgStore(0,
pSRowSet->aRow[0].lpProps[0].Value.bin.cb,
(ENTRYID *)pSRowSet->aRow[0].lpProps[0].Value.bin.lpb,
NULL,
0,
&pStore);
OpenMsgStore returns 0x8004010F
Angus
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in message
news:OOFUlkmYGHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
OK I tried this:
LPMAPITABLE pMAPITable = NULL;
hr = pSession->GetMsgStoresTable(0, &pMAPITable); // only
nullseems
to
MAPI_BEST_ACCESSbe
MAPI_UNICODE
LPMDB pMDB = NULL;
ULONG nEntryID = 0;
LPENTRYID pEntryID = NULL;
hr = pSession->OpenMsgStore(0, nEntryID, pEntryID, 0,
|
MDB_NO_MAIL, &pMDB);
But OpenMsgStore returns 0x80040107 and of course I get a
LPMDB
pointer. What am I doing wrong?
Angus
"Dmitry Streblechenko" <dmitry@xxxxxxxxxxx> wrote in
message
thenews:OWSXDwlYGHA.4060@xxxxxxxxxxxxxxxxxxxxxxx
If you need to read the IPM.Contact messages, start with
IMAPISession::OpenMsgStore,IMAPISession::GetMsgStoresTable,
openthen
theread
IPM.Contact messages from IMAPIFolder objects that you
baseneedeither
by
reading PR_IPM_CONTACT_ENTRYID from the Inbox (if you
only
startingthedefault
Contacts folder) or by recursively traversing the folders
with
the
IPM root folder....)
In case of the regular address book entries, you already
call
OpenAddressBook(). You then need to call
IAddrBook::OpenEntry(0,
NULL,
to open the root container (IABContainer); then read the
containers
recursively. OAB address book provider just happens to
messagesits
subfolders.etc)storage
on
the IPM.Contact messages. Other AB providers (Exchange,
LDAP,
(urldo
not
use messages at all.
Play with the various MAPI objects with MFCMAPI or
OutlookSpy
thebelow)
to
better understand how the pieces fit together.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in
message
news:ulARodkYGHA.4760@xxxxxxxxxxxxxxxxxxxxxxx
Good question. But I am primarily thinking about the
items
in
Contacts
folder - yes accessible via the folder tree. And
messageI
thatunderstand
that sometimes the email address book can be
different -
is
interestedthen
the
Windows Address Book? WAB file? If not WAB would be
to
know
how
you get access to that also.
Angus
"Dmitry Streblechenko" <dmitry@xxxxxxxxxxx> wrote in
opennews:uFrBAFaYGHA.3604@xxxxxxxxxxxxxxxxxxxxxxx
Do you mean contact entries as in what you see when
you
addressthe
book (Tools | Address Book) or as in IPM.Contact
inin
theone
of
contact folders accessible through the folder tre view
isOutlook?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Angus Comber" <anguscomber@xxxxxxxxxxxxxxx> wrote in
message
news:%23ijMoq7XGHA.752@xxxxxxxxxxxxxxxxxxxxxxx
Hello
Code below is what I have achieved so far. Problem
&pAB);AnythingaI
am
contactstuckbit
as
to how to get any further. I want to extract all
the
entries.
I
could start by first just getting Display Name.
Whatreally.
mapi32.libdo
I
do next?
This is a console app and I have include mapix.h and
linked
if (MAPIInitialize(0) == S_OK)
printf("MAPI initialised\n");
ULONG ulFlags = 0;
ulFlags = ulFlags | MAPI_LOGON_UI | MAPI_NO_MAIL |
MAPI_EXTENDED;
LPMAPISESSION pSession;
HRESULT hr = MAPILogonEx(0, 0, 0, MAPI_USE_DEFAULT |
MAPI_EXPLICIT_PROFILE,
&pSession);
LPADRBOOK pAB;
hr=pSession->OpenAddressBook(0, 0, AB_NO_DIALOG,
getting
But not sure now how to iterate through contact
items
contents.
Any
help would be much appreciated.
Angus
.
- Follow-Ups:
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- References:
- What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Dmitry Streblechenko
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Dmitry Streblechenko
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Dmitry Streblechenko
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Dmitry Streblechenko
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Dmitry Streblechenko
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- Re: What is next step to extracting PST contact items
- From: Dmitry Streblechenko
- Re: What is next step to extracting PST contact items
- From: Angus Comber
- What is next step to extracting PST contact items
- Prev by Date: IMessage->SubmitMessage fails with 0xC0000005
- Next by Date: Re: How to read a .OST file using Extended MAPI
- Previous by thread: Re: What is next step to extracting PST contact items
- Next by thread: Re: What is next step to extracting PST contact items
- Index(es):
Relevant Pages
|