Programmatically navigating Folders via Outlook Automation

[Visual Basic 2015]

Hi, I am using Outlook Automation to access PST files locally as I need to export data out of them, I have this working perfectly fine.

I have come to an issue where if a user selects a subfolder within the subfolder, the program won’t work.

I need away to convert something like this string:

PST FileDeleted ItemsClient 1Subject 1 

to this

Outlook.MAPIFolder = oNS.Folders("PST File").Folders("Deleted Items").Folders("Client 1").Folders("Subject 1") 

programmatically. The folder the user selects may only be 1 subfolder down, or it could be 5, but I cant find a way to add .Folders(x) as required.

Any help appreciated, and please ask questions as I know I haven’t explained this well.

I have this which I think is my starting point…

Dim complete() = Split(complete_path, "") For k = 0 To complete.Count ??? Next 

submitted by /u/themeq
[link] [comments]

Leave a Reply