Accessing Multiple Inboxes w/ Session.Infostore Object

  • Thread starter Thread starter Ken Parchinski
  • Start date Start date
K

Ken Parchinski

I am trying to access multiple inboxes through my profile using the
session.infostore object so that I can set a message filter on the inbox to
determine the daily number of emails received. I am having difficult
associating an inbox folder for a given infostore to set the message filter.

Thanks in advance.

Ken

On Error GoTo ERR_ROUTINE
Set oSession = CreateObject("MAPI.Session")
oSession.Logon
For n = 1 To oSession.InfoStores.Count
Set oInfostore = oSession.InfoStores(n)
'Debug.Print oInfostore.Name, oInfostore.RootFolder.Name,
oInfostore.ProviderName
--> I am getting stuck here
Set oFolder = oSession.Inbox
Set oMessages = oFolder.Messages
Set oMessageFilter = oMessages.Filter
oMessageFilter.TimeFirst = "9/19/03"
Next
 
Inbox is an object property of the Session, not the Infostore. There's no guarantee that any given Infostore will even have an inbox. Aside from the default store, you'll need to get inboxes from other stores by name as a subfolder of the store's RootFolder folder.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Back
Top