Explanation of Items count?

S

salad

I have the following code.
Dim Olapp As Object
Dim Olmapi As Object
Dim Olfolder As Object

Set Olapp = GetObject(, "Outlook.Application") 'get reference
Set Olmapi = Olapp.GetNamespace("MAPI")
Set Olfolder = Olmapi.GetDefaultFolder(6) '6 for olfolderinbox

MsgBox Olfolder.name & " " & Olfolder.Items.Count

The folder name is Inbox and the count is 80. I can't figure out where
it gets the number 80. I expected the count of 30 which is what I have
in my Inbox.

In the pane Mail/Favorite Folders I have
Inbox 30
Unread 30
Sent 8
Deleted 6

In the pain PersonalFolders I have
Drafts 18
Inbox 30
Junk 51
DeletedItems 6
Sent 8

Under ArchiveFolders I have
DeletedItems 29
SentItems 5

DeletedItems (29) = Junk (51) equals 80 but that doesn't make sense.

Do you have any idea what is being tallied?
 
K

Ken Slovak - [MVP - Outlook]

Are you sure that your view isn't set to something like unread items only?
The count of the Items collection should match what's in your Inbox in the
default store (where you get your email delivered). Usually when there are
discrepancies it's due to the view being used.
 
S

salad

Ken said:
Are you sure that your view isn't set to something like unread items
only? The count of the Items collection should match what's in your
Inbox in the default store (where you get your email delivered). Usually
when there are discrepancies it's due to the view being used.
My mind is made of mush. Low grey matter count.

The counter for inbox said 30. Unread said 30. So I went into inbox
and arrowed downwards past Today, Yesterday, last month, wayback and the
counter kept going down to 0 as each message was "viewed" and now there
is no counter and the item count for the entire inbox was 80 by my count.
 

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

Top