title: VBA to select mailbox if an account has multiple mailbox's
body: <p>Here is my requirement.</p>
  
  <p>I have multiple accounts in my OUTLOOK configured.
  1) 1@email.com (only one mailbox)
  2) 2@email.com (Multiple mailbox's are there. ex: Unix box, Windows Box, Mac box)</p>
  
  <p>Here my 2nd email account has its own mailbox and linked to  multiple mailbox's like UNIX, Windows etc. Each Mailbox has its own inbox and sub folders.</p>
  
  <p>Now i need to select a folder in Unix box (inbox) and run the code to do something in side the folder.</p>
  
  <p>Here's what i have </p>
  
  <pre><code>For Each oAccount In Application.Session.Accounts
  If oaccount ="1@email.com" then
  Set folder = ns.GetDefaultFolder(olFolderInbox) ' here it selects the inbox folder of account.
  For each item in folder.items
  Code goes here
  next
  end if
  next
  </code></pre>
  
  <p>This works fine for single mailbox account, but when i do this for multiple mailbox account , it doesn't work.</p>
  
  <p>any help would be appreciated.</p>