Greg
Greg

Reputation: 37

C# Moving a selected mail item to inbox subfolder

can anyone provide an example of how to move a selected inbox item to a inbox subfolder hitting a wall with the moveitem function.

Thanks

Upvotes: 1

Views: 3013

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66245

MAPIFolder inbox = Globals.ThisAddIn.Application.Session.GeteEfaultFolder(OlDefaultFolders.olFolderInbox)
MAPIFulder subfolder = inbox.Folders["Subfolder Name"];
MailItem mail = Globals.ThisAddIn.Application.ActiveExplorer.Selection[1];
mail.Move(subfolder);

Upvotes: 2

Related Questions