PDA

View Full Version : need to move task or mail etc....



saban
02-11-2008, 02:21 PM
This is killing me, it is very frustrating :(

I would like to move task to another mailbox's task folder and it is no way I can do this, I always get an error that object could not be found,

I can move it to a default folders but I cannot move it to another mailbox

This really sucks, sounds like such an easy job but I am totally lost

Any ideas

Please
saban

Qubit
03-04-2008, 05:41 PM
See attached to get the mechanics of moving items.
Make sure you File->Open->PST file to open the destination PST file before beginning.
(It has to be open so you can select the destination folder)

Basically, create a MAPIFolder object for both the source and destination folders (they don't have to be in the same PST file).

Then processing the items from end to beginning, you can move them from one to the other.

We process backwards (for x = items.count to 1 step -1) to preserve the index. If we processed forwards, the list would be mixed up as soon as we remove one. By moving backwards, it doesn't.

The attached code snip does not check for errors, and only looks for mail item types. I would ensure that the source and destination folders both have the same item types.

And...only one user can have a PST file open.

Cheers.
Q.

saban
03-11-2008, 03:10 PM
Thnx man I appreciate this, will look into it