For Each Email (Use Desktop Outlook App): Find parent folder of each item

For Each Email with Use Desktop Outlook App does indeed do a good job of iterating through all the emails in a folder and optionally, it’s subfolders; however, I’m having trouble finding a way to tell what subfolder each item is coming from when I use the “include subfolders” check box.

It doesn’t appear that any of the attributes of CurrentMail return the item’s parent folder.

I would love to hear ideas on how to do that?

@Bill_Richardson

You can try following.
mail

.ParentDolderId doesn’t seem to be an attribute of the MailMessage type.

I get a syntax error:
Argument ‘Value’ : BC30456 'ParentFolderId is not a member of ‘MailMessage’

I guess I can look for ways to find the parent with VBA. Was hoping it was just hidden somewhere in one of the Outlook integrations.

@Mohan_Reddy ,

Oh I see, you are probably talking about the Modern Office365 activities for Outlook. I see that the CurrentEmail.ParentFolderId does exist there.

Excellent! Thanks.

One other thing–do you know of an easy way to get the folder name from that ParentFolderId?