Getting inbox items detail

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


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 for a lot of helpful info.



Roy Goldhammer

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question