Article ID: 195380
Article Last Modified on 3/4/2004
Dim objSession As MAPI.Session
Dim objMsgColl As Messages
Dim objMsg As Message
Dim objInbox As Folder
'Create the Session then Logon.
Set objSession = CreateObject("MAPI.Session")
objSession.Logon "YourProfileName" 'TO DO: Enter a valid profilename
Set objInbox = objSession.Inbox
'Note: DeliverNow should be called after accessing the store,
' otherwise it will have no effect.
' objSession.DeliverNow
Set objMsgColl = objInbox.Messages
For Each objMsg In objMsgColl
MsgBox "Subject: " & objMsg.Subject
Next
Set objMsg = Nothing
Set objMsgColl = Nothing
Set objInbox = Nothing
objSession.Logoff
Set objSession = Nothing
182062 OL98: Working with Personal Folders
Keywords: kbmsg kbprb KB195380