outlook 2010 mail item count doesnt match display

Status
Not open for further replies.

Terri Jones

New Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Re: work email account outlook 2010/exchange server. Using excel macro I capture all outlook messages into a spreadsheet. I receive upwards of a thousand emails daily. Using a for next loop I move through the mail item count and record them in excel. The mail item count is half of the displayed total. If I have 250 messages the mail item count will return 125 causing me to run the process multiple times to clear inbox. the next round picks up 62, then 31, then 16,8,4,2,1 etc.. (This is not a priority with our IT dept. I am on my own and trying to workaround issue).

I want to retest item count within the current macro to keep working to get to an empty inbox. Current mail item counts are not correct, do not match the displayed totals. I am thinking about having macro make multiple attempts to loop through a testing sequence that set outlook/run macro that records messages/clear instance/reset outlook instances until the inbox mail item count returns 0 before exiting macro process. Does this seem plausible? Any suggestions? Is there another collection where I could obtain a more reliable count?
 
Do you remove the items in your loop? If so, loop backwards. While Count correctly returns the remaining items, it's the index that points to non-existing items.
 
Hi Michael,
Sorry for the delay. Thought I had asked for email notifications.


Yes I am removing the items as I loop through them.
Here's where I am capturing count

For iRow = 1 To Folder.Items.Count
'not exactly sure what reversing the loop looks
To reverse would that be
For iRow = -1 to Folder.Items.Count
or
For iRow = Folder.Items.Count to -1

Thanks
T
 
Thanks Michael for putting me on the right track. This code works
imailcount = Folder.Items.Count
For iRow = imailcount To 1 Step -1
Set Msg = Folder.Items(iRow)

thanks again
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Duplicate Primary Mail Accounts outlook 2010 Using Outlook 0
N Creating or changing the main new mail message template in Outlook 2010 Using Outlook 2
S Translate mail directly in Outlook 2010 Using Outlook 0
T Outlook 2010 - Contacts associated with an e-mail address Using Outlook 1
H Outlook 2010 unable to send iCloud account e-mail after iOS 7 upgrade Using Outlook 12
F Outlook 2010 contact e-mail Display as: does not show contact name Using Outlook 2
B How to have Outlook 2010 Calendar when your mail server is Imap? Using Outlook 10
T sent mails in outlook 2010 not coming in the yahoo mail Using Outlook 1
W Microsoft Mail & 2010 Outlook Using Outlook 1
T Make Default Outlook 2010 Client Mail Using Outlook 1
H Importing Windows Live Mail Contact into Outlook 2010 Using Outlook 0
F CAN'T SAVE OUTLOOK 2010 E-MAIL TEMPLATE (.oft) Using Outlook 1
N Sending encrypted signed mail using outlook 2010 Using Outlook 1
C migrating from Windows Live Mail over to Outlook 2010 Problems ... Using Outlook 2
R Outlook 2010 Sent emails don't appear in the sent mail folder Using Outlook 9
M Mail in HTML format can't be sent if url or number is in the body Outlook 2010 Using Outlook 2
S Outlook 2010 is not deleting mail from my server once downloaded Using Outlook 2
C Text reply mail in Outlook 2010 has automatic margin indent Using Outlook 9
B Outlook 2010 and MS Mail Using Outlook 11
A Attaching mail items in Outlook 2010 Outlook VBA and Custom Forms 5
R Outlook 2010 No Longer Deletes Mail From Server Using Outlook 7
S Adding a recipient's column to Sent folder in Outlook 2010 Outlook VBA and Custom Forms 1
e_a_g_l_e_p_i Can emails from Gmail be deleted when they are downloaded to Outlook 2010 Using Outlook 1
L Outlook 2010 Outlook 2010 Outlook VBA and Custom Forms 2
C What folders are needed when reinstalling Outlook 2010 Using Outlook 0
e_a_g_l_e_p_i Gmail in Outlook 2010 preview issue Using Outlook 4
e_a_g_l_e_p_i Outlook 2010 Help setting up Gmail account in Outlook 2010 Using Outlook 3
B Outlook 2016 Unable to view images or logos on the outlook 2016 emails the same html code works well when i use outlook 2010 Using Outlook 0
M Outlook 2010 Outlook 2010 with O365 / Exchange Online Using Outlook 0
F Outlook 2010 Outlook 2010 and GMail Using Outlook 0
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
e_a_g_l_e_p_i I think it may be time to upgrade from Outlook 2010 Using Outlook 3
T Why does outlook 2010 convert only some forum notifications to plain text? Using Outlook 0
I Error saving screenshots in a custom form in outlook 2016, outlook 365 - ok in outlook 2013, outlook 2010 Outlook VBA and Custom Forms 5
M Outlook 2010 Problem with OutLook 2010 32 bit, after Windows Auto Update Using Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
D Outlook 2010 account setup fails in particular domain Using Outlook 3
B Outlook 2010 is Auto Purging when not configured for that Using Outlook 1
W Outlook 2010 Reading Pane Slows Startup Using Outlook 3
S Outlook 2010 unable to change default font Using Outlook 7
B Outlook 2010 Can not find a certain file in M/S Outlook 2010. Using Outlook 1
Mark Foley Cannot enable add-in in outlook 2010 Using Outlook 0
W Outlook 2010 some sent items marked unread now (was Ok before) Using Outlook 0
RBLampert Updating from Outlook 2010 to Outlook 365 Using Outlook 0
L What are the risks of opening an Outlook 2016 .pst file in Outlook 2010? Using Outlook 4
S Unable to remove rule outlook 2010 Using Outlook 0
N Outlook 2010 Flag blocked for Safe Senders List???? Using Outlook 7
dweller Outlook 2010 Rule Ignores VBA Script Outlook VBA and Custom Forms 2
Mark Foley Unable to subscribe to published calendar in Outlook 2010 Using Outlook 4
K Maximum Categorize Shortcuts In Outlook 2010? Using Outlook 1

Similar threads

Back
Top