Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / August 2003

Tip: Looking for answers? Try searching our database.

Moving E-Mails from .PST to .PST

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Serge Rozentsvet - 26 Aug 2003 14:22 GMT
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.
Dmitry Streblechenko - 26 Aug 2003 21:29 GMT
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,
>
[quoted text clipped - 17 lines]
>
> Any help will be greatly appreciated.
Sergei Rozentsvet - 27 Aug 2003 15:13 GMT
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
[quoted text clipped - 29 lines]
>
>.
Sue Mosher [MVP] - 27 Aug 2003 16:49 GMT
If you have the folder path, you can use that to walk the hierarchy -- see http://www.slipstick.com/dev/code/getfolder.htm 
Signature

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
    http://www.outlookcode.com/jumpstart.aspx 

> Dmitry,
>
[quoted text clipped - 63 lines]
> >
> >.
Serge Rozentsvet - 29 Aug 2003 15:05 GMT
That's great help Sue, thanks a lot. The website has
exactly what I need.

Thanks again.

>-----Original Message-----
>If you have the folder path, you can use that to walk the hierarchy -- see
http://www.slipstick.com/dev/code/getfolder.htm
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.