Searching for a folder in outlook folders
<p>I am working on a VSTO project using C#. I am facing difficulties in an issue which is: I want to search for a specific folder (which I know its name) in all outlook folders that appear to the right (example: Inbox, SentItems, Drafts, ....). Does anyone know how can I achieve this ? N.B: After some research, I found this piece of code:
Outlook.Folder inbox =Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)as Outlook.Folder;</p>

<p>foreach (Outlook.MAPIFolder tempFolder in inbox.Folders)
  {</p>

<pre><code>      if (tempFolder.Name == "Sample Folder")
      {
                     isFind = true;
      } 
</code></pre>

<p>}</p>

<p>The issue here is that I have to hard code all folders (i.e. write several foreach loops that iterates through all folders). So, my question again: Is there w way to loop through all Outlook folders without categorizing them as Inbox, SentItems, ...etc ?? Thanks in advance.</p>

<p>Regards,</p>
