1. Use Namespace.AddStore/RemoveStore
2. To save in the MSG format, call
MailItem.SaveAs "path" olMsg
EML files are not directly supported by Outlook; you'd have to either
programmatically create EML files from the message properties using Extended
MAPI or CDO 1.21 (OOM is not really up to the task) or <plug> you can use
Redemption (url in my sig.) - see SafeMailItem.SaveAs ..., olRFC822 and
SafeMailItem.Import ..., olRFC822 </plug>
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"ksskumar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I need to store selected mails into some different .pst file at
> runtime. Also want to access those mails in .pst at runtime. I can
> import and export mails into .MSG file. But it is hard to maintain
> mails as .msg files.
>
> My queries are,
>
> 1. How to create/open .PST file at runtime ?
> 2. How to add/delete (import/export) mails (any format like .MSG,
> .EML, etc.,) into .PST at runtime ?
>
> Is there any way to handle this kind of situation thru Outlook object
> model or CDO or Extended MAPI or Redemption or any other way?
>
> Thanks in advance
>
> with best regards,
> Kumar