Getting inbox items detail

  • Thread starter Thread starter Eric Legault [Outlook MVP]
  • Start date Start date
E

Eric Legault [Outlook MVP]

A MAPIFolder object for a specified folder contains an Items collection that
indicates all the messages that are contained in that folder. Accessing
Items.Count will tell you how many. The code below shows how to retrieve
your Inbox.

Dim objNS As Outlook.NameSpace
Dim objInbox As Outlook.MAPIFolder

Set objNS = Application.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)

To get item level details for a message, you need to retrieve the
appropriate object (MailItem, TaskItem, etc.) from the Items collection and
access the needed properties to get the information you are looking for
(SenderName, ReceivedTime, Body, Attachments, etc.).

Try looking through the Object Browser or the VBA help file to get a handle
on what objects expose which properties. Also check out
http://www.outlookcode.com for a lot of helpful info.
 
Hello there

Is there a way with vb code to know how many items are on the inbox

and what are their details (recived, from, text, attachment ect....)

any help would be greatful
 
Back
Top