Searching Secondary Outlook Account Inbox
<p>I am working to automate a recurring task.</p>

<p>Search an e-mail inbox (not the primary Outlook account) for items with a subject that contains: "Acting / Additional".</p>

<pre><code>Sub SrchRF4AAABonuses()
Dim myOlApp As New Outlook.Application
Dim objNamespace As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim filteredItems As Outlook.Items
Dim itm As Object
Dim Found As Boolean
Dim strFilter As String

Set objNamespace = myOlApp.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
strFilter = "@SQL=" &amp; Chr(34) &amp; "urn:schemas:httpmail:subject" &amp; Chr(34) &amp; " like '%Acting / Additional%'"

Set filteredItems = objFolder.Items.Restrict(strFilter)

If filteredItems.Count = 0 Then
Debug.Print "No emails found"
Found = False
Else
Found = True
' this loop is optional, it displays the list of emails by subject.
For Each itm In filteredItems
 Debug.Print itm.Subject
Next
End If ...
</code></pre>

<p>....</p>

<p>The above code searches my default e-mail (for instance, jsmith@example.com), however, I have a secondary e-mail called Retail Finance , (rfin@example.com) and I want to search that e-mail addresses inbox. How can I modify my code to accomplish this?</p>

<p>I'm new to Outlook VBA, sorry if this is basic.</p>