If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Outlook 2007 items.count incorrect
Outlook 2007, Win 7 64bit. Running code in the newmail event. Works
perfectly on Outlook 2003: I set my object to the inbox folder: Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox) then here is my test code: MsgBox objFolder.Items.Count MsgBox objFolder.Items.Count The first occurrence of the Msgbox shows "0", the second shows "1" (which is correct) Any ideas??? John |
Ads |
#2
|
|||
|
|||
Outlook 2007 items.count incorrect
Keep in midn that MAPI events are asynchronous and it is possible that
NewMail event is fired before the message is actually created/saved in the Inbox folder. Why not use the Items.ItemAdd event on the Inbox folder? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Johnb" wrote in message ... Outlook 2007, Win 7 64bit. Running code in the newmail event. Works perfectly on Outlook 2003: I set my object to the inbox folder: Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox) then here is my test code: MsgBox objFolder.Items.Count MsgBox objFolder.Items.Count The first occurrence of the Msgbox shows "0", the second shows "1" (which is correct) Any ideas??? John |
#3
|
|||
|
|||
Outlook 2007 items.count incorrect
It has worked fine in 2003 for several years. In the end I rewrote it and
triggered it from a rule. Thanks for your suggestion John "Dmitry Streblechenko" wrote in message ... Keep in midn that MAPI events are asynchronous and it is possible that NewMail event is fired before the message is actually created/saved in the Inbox folder. Why not use the Items.ItemAdd event on the Inbox folder? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Johnb" wrote in message ... Outlook 2007, Win 7 64bit. Running code in the newmail event. Works perfectly on Outlook 2003: I set my object to the inbox folder: Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox) then here is my test code: MsgBox objFolder.Items.Count MsgBox objFolder.Items.Count The first occurrence of the Msgbox shows "0", the second shows "1" (which is correct) Any ideas??? John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unread messages count incorrect on login screen | molim | Outlook Express | 3 | August 2nd 07 01:22 AM |
Explanation of Items count? | salad | Outlook and VBA | 2 | April 4th 07 06:14 PM |
error retrieving folder.items.count | kappe79 | Outlook and VBA | 3 | September 19th 06 01:29 PM |
Unread count incorrect + no spell checking | StainlessSteelRat | Outlook Express | 6 | February 26th 06 01:32 PM |
count items in an Outlook View | norm | Outlook - Using Contacts | 3 | February 6th 06 04:02 AM |