Converting individual mailbox to a file using MAPI

  • Thread starter Thread starter duraisridhar
  • Start date Start date
D

duraisridhar

Hi All,

I am looking for a way to backup individual mail box of our Exchange
Server 2003.I want to convert my individual mail box to a file and
backup it. Can any help me with what MAPI methods i can achive
this(though MAPI is not designed for backup). Should I read each mail
of mail box and write it to a file ?.

Any help on this will be greatly apppreciated.

Regards,
Sridhar D
 
Hi All,
After googling, I understand that exporting mailbox to .pst file can
be achieved through NameSpace functions and CopyTo method Is there any
methods equivalent to NameSpace AddStore?. I doesn't want to include
MFC in project.

Regards,
Sridhar D
 
First of all, NameSpace AddStore has absolutely nothing to with MFC - it is
an Outlook Object Model method, which can be called with or without MFC.
If you don't want to use OOM but prefer Extended MAPI, you will need to add
and configure the "MSPST MS" service (or "MSUPST MS" in case of Unicode PST
in Outlook 2003) - there were numerous posts dealing with this subject in
this newsgroup, e.g. see
http://groups.google.com/group/micr...streblechenko+mspst+ms&hl=en#2b771b3730022d77

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Hi Dmitry ,
Thanks for your input. How should I copy my Mail box after
configuring the MSUPST MS service . Any MAPI methods to accompilish my
primary goal of copying mail box to .pst file while using the "MSUPST
MS" service.

Thanks for your time,
Regards,
Sridhar D
 
Open the PST store you just added (IMsgStore), then copy the messages/folder
from the exchange store to the newly added PST store.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Hi,
Thanks for your suggestions. I tried copying individual mailbox to
newly created folder, but CopyTo call failed with error
MAPI_E_NOT_FOUND. Both the store opened with MAPI_BEST_ACCESS and
lpInterface value NULL(default) while opening. The lpInterface value in
CopyTo method is IID_IMsgStore.Here is what I'm passing to CopyTo
method.

HRESULT copyResult = oldlpMDB->CopyTo(0, NULL, NULL, 0, NULL,
(LPCIID)&IID_IMsgStore,
newLPMDB,
0,
&lpspropProblemArray);

Can any one guess where I'm going wrong.
Thanks in Advance,

Thanks & Regards,
Sridhar D
 
Hi Dmitry ,

It worked like a charm . Thanks for your quick responses.

Regards,
Sridhar D
 
Hi ,
CopyFolder fails for set of Folders likely Notes, Outbox, Sent Items,
Tasks and special folders created by user.
I couldn't infer anything form the error "MAPI_W_PARTIAL_COMPLETION",
I receive.
Is anything i'm missing?.

Regards,
Sridhar D
 
You might be better off explcitly creating new destination folders
recursively and copying messages one at a time.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Hi Dmitry,
Thanks for your inputs. Few more queries on copying messages.

1) Would Copying messages level affect perfomance of the my
application and the Exchange Server I had logged in ?.

2) Should I Copy individual messages of each folder or just delete
the folder with error and proceed copying inidividual messages of
particular problematic folder ?. I'm aware that problem might arise at
the last stage of Copying Folder and hence Copying messages again from
the starting will surely cost me.

Can I find what made problem ("MAPI_W_PARTIAL_COMPLETION" error ) on
IMAPIFolder::CopyFolder call using extended erors.

Thanks again for your suggestions.

Regards,
Sridhar D
 
1. Of course. Accessing Exchange server, no matter what you do, affects its
performance.
2. Why do you want to delete anything? I thought you were tryign to copy
messages and folders? If you copy one message at a time, it is as atomic as
it gets. If a particular message cannot be copied for some reason, it surely
does not affect any other message.

MAPI_W_PARTIAL_COMPLETION means "some things were successful, but some
failed". Which can means "1 out of 1,000,000 messages failed". Or it can
mean "999,999 out of 1,000,000 messages failed".

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

I'm trying to programmatically determine the "version" of very many PSTs.
BTW, I'm using OOM via Perl's OLE module.
First, I open each PST using:
my $PST = $namespace->AddStore("c:\path\to\this.pst");

Which works fine. However, I haven't been able to discover a way to
determine each PST's "version" (pre-/post-2003).

Can someone point me in the right direction (or to the right object)?

Thanks.
 
First of all, please do not hijack an existing thread, create a new one,
especially if your question has nothing to do with the existing thread.
Secondly, AFAIK the only way to distinguish between the ANSI and Unicode
PSTs is to read the PR_STORE_SUPPORT_MASK property from the mesage store
(IMsgStore) and check if the STORE_UNICODE_OK bit is present.
See http://support.microsoft.com/kb/884671 and
http://support.microsoft.com/newsgr...&tid=b5ade106-2403-41e9-8825-302c4cfa803b&p=1

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