From msAccess find correct email account in outlook

Access 2010 vba

What Am I trying to do:
Trying to perform a search in the correct    "Inbox"

First. : When i open my outlook  I have several Profiles under my Primary profile



I tried to access the profile directly but it still only searches in the main "InbOx"    (

Before I perform a search I need to make sure I'm looking in the correct profile ?
before i execute any code..

I'm trying to loop through each profile but this is not working ?

Dim objOL As Outlook.Application
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.Namespace
Dim myInbox As Outlook.MAPIFolder
Dim myitems As Outlook.Items
Dim myitem As Object
Dim objInsp As Outlook.Inspector
Dim oAccount As Outlook.Account

For Each oAccount In myOlApp.Session.Accounts
  If oAccount = "redbook" Then
      ' code here
  end if

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

John TsioumprisSoftware & Systems EngineerCommented:
Add a watch at

Open in new window

and check from the watch window what properties and methods are available...maybe it needs a different approach...
FordraidersAuthor Commented:
I did , it will not loop

FordraidersAuthor Commented:
it finds my main

but will not find the others.

Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

John TsioumprisSoftware & Systems EngineerCommented:
There seems to be a Stores collection that "contains" the Outlook Accounts
Take a look here

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FordraidersAuthor Commented:
That was it ...even my admin for outllok kept calling them profiles. I knew their had to be a specific profile name under current session "Stores"...Phew..

That worked.. had to change a set statement but it listed the stores(profiles).

Dim colStores As Outlook.Stores
Dim oStore As Outlook.Store
Dim oRoot As Outlook.folder
 Set colStores = Outlook.Application.Session.Stores
 For Each oStore In colStores
 Set oRoot = oStore.GetRootFolder
 Debug.Print (oRoot.FolderPath)


Thanks !
John TsioumprisSoftware & Systems EngineerCommented:
Glad it worked out like you wanted
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.