Get outlook mail message in all folders and subfolders

Hello,

I want to retrieve any email containing a filter on the subject of an email, however I am required to specify a folder in the “MailFolder” entry.

The script will be used on multiple mailboxes, and I don’t know in advance the folders and subfolders present in this mailbox.

Can you tell me how to do that?

Thank you in advance.

@valentinw
If you use an In Argument as the name of your MailFolder you can specify which folder should be used each time you run the process.


image

1 Like

Thank you for your answer, however I am trying to search all the folders in the outlook box without having to specify which ones because each outlook account has different folders whose names I do not have.

@valentinw
If you need to dynamically get folder names you’ll probably need to write something custom using the Outlook Interop library.

Or you could open Outlook and scrape all of the folder names once it is opened.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.