2

I'm using Outlook Redemption library (http://www.dimastr.com/redemption/home.htm) for my Outlook AddIn. I want to move multiple mails from an exchange account to a PST store.

onlineAccountFolder.Items.MoveMultiple(onlineEntryIds, targetFolderInPstStore);

The source folder mails were cut from the Exchange account, but not pasted in the target folder. They are gone.

I tried the same operation on an Exchange account folder in the same store and the move operation was successful. The items were moved to the target folder.

There's no overload of the 'MoveMultiple' method where I can define a StoreID.

Community
  • 1
  • 1
pego
  • 117
  • 1
  • 9

2 Answers2

1

I had no problem with the following script executed from OutlookSpy (I am its author - click “Script Editor” button on the OutlookSpy toolbar, paste the script, click Run.

The script moves the messages selected in Outlook to a folder returned by the PickFolder method. Works as expected with both PST and Exchange target folders.

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
dim messages()
set sel = Application.ActiveExplorer.Selection
redim messages(sel.Count-1)
for i = 1 to sel.Count
  messages(i-1) = sel.Item(i).EntryID
next
set targetFolder = Session.PickFolder
set sourceFolder = Session.GetFolderFromID(Application.ActiveExplorer.CurrentFolder.EntryID)
sourceFolder.Items.MoveMultiple messages, targetFolder
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • 1
    Thanks for your support - I checked the code again and fixed some issues - probably some configurations were wrong and that's why the move operation didn't work. Now with all the fixes everything works fine :-) btw. your library is insanely fast - well done!! – pego Jul 04 '19 at 18:44
0

Use the Move method of the RDOMail class to move items between stores in Outlook.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Thx for your response - I thought that already. I'm searching all the mails in my folder via MAPITABLE (+filter) and want to move only some of them. Is there a way to move a single mail item without loading the RDOMail completely? – pego Jul 04 '19 at 16:26
  • It looks like no if the `MoveMultiple` method doesn't work between stores. – Eugene Astafiev Jul 04 '19 at 16:35