outlook folder
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hello, I need to find a specific mail message in outlook according it's subject. I want the program to search the mail in all the folders (including in personal folders and all sub-folders) . How can i do it? I wrote this thing: Outlook.Application oApp = new Outlook.Application(); Outlook.NameSpace oNS = oApp.GetNamespace("mapi"); oNS.Logon(Missing.Value, Missing.Value, false, true); Outlook.MAPIFolder oIFolder = oNS.Folders.GetFirst(); Console.WriteLine(oIFolder.Name); int nFolderCount = oNS.Folders.Count; for (int p=1; p<=FolderCount; p++) { if(oIFolder[p].Name=="name") return true; } } The thing is that it checks only the folder name and also it is not working recursively and i don't know how to do it. Any help?