PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Accessing Multiple Inboxes w/ Session.Infostore Object
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Accessing Multiple Inboxes w/ Session.Infostore Object
![]() |
Accessing Multiple Inboxes w/ Session.Infostore Object |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 http://www.outlookcode.com/jumpstart.aspx "Ken Parchinski" <kparchinski@callargi.com> wrote in message news:uxcnSxsfDHA.2576@TK2MSFTNGP11.phx.gbl... > 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 > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

