Saving email messages with path

G

Guest

Hello everybody,

I run OL2003, I have 3 POP3 email accounts with 3 .pst files one for each
account.

Please help me with the following problem: I would like to save the messages
and with the path from the .pst files. For example:
the message - Work2006\Inbox\Sales\offer123 which is stored inside the file
Work2006.pst to be able to save it (including the path) to My Documents
folder like ..... My documentsWork2006\Inbox\Sales\offer123.msg.

Pls keep in mind that the folders does not exist inside My Documents and
should be created by VBA.

I have tried something but I have difficulties getting the folders and
subfolders of the .pst file.

There is another problem I have faced when I tried to save the messages:
When encounter a report (read receipt) object (not a mail object) sometimes
it saves it and sometimes no. I do not understand why ...

A helping hand will be very appreciated.
Thanks in advance.

Catalin
 
M

Michael Bauer [MVP - Outlook]

Am Tue, 31 Oct 2006 07:53:01 -0800 schrieb Catalin:

For the path you can get each item´s Parent.FolderPath property, whcih
returns the folder´s path. That result starts with two back slashes, strip
out th efirst one with:

Dim Path as string
Dim Item as Outlook.MailItem

... getting the item
Path=Item.Parent.FolderPath
Path=Mid$(Path, 2)

For creating the path you can add a reference (Tools/References) to the
Microsoft Scripting Runtime, then use its FileSystemObject.CreateFolder
function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top