Moving E-Mails from .PST to .PST

S

Serge Rozentsvet

Hi,

I am looking for quick solution/script that will allow me
to move an eMail item from one .PST file to another.

My problem is that the eMail item could be in one or more
SUBFOLDERS and I need to move it to exact same location
in a different .PST file.

For example -
Move eMail item from [My E-Mails PST] \ [Inbox] \ [Work]
to [My Archive PST] \ [Inbox] \ [Work].

The catch is that I cannot use the .PARENT propery of the
eMail since I do not know how many .PARENTs there are
(what if there's another folder within [Work]). Thus
the .MOVE() method does not seem appropriate, or is it ??
Is there another way to specify a destination path for
the .MOVE() method?

Any help will be greatly appreciated.
 
D

Dmitry Streblechenko

No, you need to hold a reference to the destrination folder. You can get it
either from walking the folder tree starting from Namespace.Folders, or by
using Namespace.GetFolderFromID()

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

Sergei Rozentsvet

Dmitry,

Bolshoe spasibo za sovet.

I thought about walking through the folders
(Application.GetNamespace("MAPI").Folders.Item("My E-
Mails")) but the problem is that I do not know how deep
to go. Ideally I am looking for a solution where I could
use the FolderPath property of the folder and simply use
it (just change part of the string to accomodate for a
different .PST name) in item.Move() method.

I am not very familiar with the GetFolderFromID() method
and do not see how it can help me (I believe this method
relies on CLSID-like folder IDs).

I will appreciate it very much if you could assist me
further with this problem. It would be great if you could
give me an example of any viable method I could use.

Thank you once again,

Sergei Rozentsvet

-----Original Message-----
No, you need to hold a reference to the destrination folder. You can get it
either from walking the folder tree starting from Namespace.Folders, or by
using Namespace.GetFolderFromID()

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


Hi,

I am looking for quick solution/script that will allow me
to move an eMail item from one .PST file to another.

My problem is that the eMail item could be in one or more
SUBFOLDERS and I need to move it to exact same location
in a different .PST file.

For example -
Move eMail item from [My E-Mails PST] \ [Inbox] \ [Work]
to [My Archive PST] \ [Inbox] \ [Work].

The catch is that I cannot use the .PARENT propery of the
eMail since I do not know how many .PARENTs there are
(what if there's another folder within [Work]). Thus
the .MOVE() method does not seem appropriate, or is it ??
Is there another way to specify a destination path for
the .MOVE() method?

Any help will be greatly appreciated.


.
 
S

Sue Mosher [MVP]

If you have the folder path, you can use that to walk the hierarchy -- see http://www.slipstick.com/dev/code/getfolder.htm
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



Sergei Rozentsvet said:
Dmitry,

Bolshoe spasibo za sovet.

I thought about walking through the folders
(Application.GetNamespace("MAPI").Folders.Item("My E-
Mails")) but the problem is that I do not know how deep
to go. Ideally I am looking for a solution where I could
use the FolderPath property of the folder and simply use
it (just change part of the string to accomodate for a
different .PST name) in item.Move() method.

I am not very familiar with the GetFolderFromID() method
and do not see how it can help me (I believe this method
relies on CLSID-like folder IDs).

I will appreciate it very much if you could assist me
further with this problem. It would be great if you could
give me an example of any viable method I could use.

Thank you once again,

Sergei Rozentsvet

-----Original Message-----
No, you need to hold a reference to the destrination folder. You can get it
either from walking the folder tree starting from Namespace.Folders, or by
using Namespace.GetFolderFromID()

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


Hi,

I am looking for quick solution/script that will allow me
to move an eMail item from one .PST file to another.

My problem is that the eMail item could be in one or more
SUBFOLDERS and I need to move it to exact same location
in a different .PST file.

For example -
Move eMail item from [My E-Mails PST] \ [Inbox] \ [Work]
to [My Archive PST] \ [Inbox] \ [Work].

The catch is that I cannot use the .PARENT propery of the
eMail since I do not know how many .PARENTs there are
(what if there's another folder within [Work]). Thus
the .MOVE() method does not seem appropriate, or is it ??
Is there another way to specify a destination path for
the .MOVE() method?

Any help will be greatly appreciated.


.
 

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