This is the problem:
I am using C# with the Interop.Outlook library. I can get to the shared folder which is where the emails are located that I need to scan and grab values to input into a delimited text file to be transferred into a spreadsheet.
However currently the program only scans the emails in the parent level shared inbox folder. Most of the emails that I need are in this folder but there are a few sub folders within inbox that I need to scan that I cannot get to at this time.
Here is the current code:
using Microsoft.Office.Interop;
Outlook.Application app = new Outlook.Application();
Outlook._NameSpace nSpace = app.GetNamespace("MAPI");
Outlook.Recipient recip = nSpace.CreateRecipient("sharedFolderName");
recip.Resolve();
Outlook.MAPIFolder theParent =
nSpace.GetSharedDefaultFolder(recip, OlDefaultFolders.olFolderInbox).Parent;
Outlook.MAPIFolder shared =
nSpace.GetSharedDefaultFolder(recip, OlDefaultFolders.olFolderInbox);
Outlook.MAPIFolder subFolder =
theParent.Folders["Inbox"].Folders["FolderNameINeedToScan"];
I think my problem is on the last line I have tried to remove the second .Folders but that just gets the parent inbox. The current error that is returned is "An Object could not be found." The folder that I am looking for does exist.
How can I get to the child folders in Outlook?