Outlook AddOn How to get selected emails?

I am creating an additional addon, and I am trying to find a way to see which emails are selected, and then be able to work with them through foreach (or something else). If this is not possible, is there a way to get all the items in the folder and easily access this information? After that I need to move these items to another folder.

How should I do it?

+3
source share
1 answer

You can use the Application.ActiveExplorer method to get the current active explorer window (= what displays a list of letters). You can then use the Explorer.Selection property to get a list of selected email messages.

To move mail, use the MailItem.Move method .

+6
source

Source: https://habr.com/ru/post/1737134/


All Articles