![]() |
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
|
|||
|
|||
![]()
Hi there,
I am not looking for resolution, in fact I have found something I wish to share. Perhaps some of the experts might be able to validate it or even provide the reasons why. I have seen a couple of posts here hinting at this problem but from what I can see, it wasnt resolved. I have been trying to get my app to correctly determine the number of Items in a folder that have their NoAging property set to False, or more accurately, Not set to True (as I wish to ignore the items that are set as "Do Not Archive". NoAging=True means "Do Not Archive"). Interestingly, I ran into the problem where the Restrict method of the items collection was returning the incorrect number of items when I set NoAging=False. For example, in my Inbox, there were 69 messages, the Restrict filter returned 38 that were NoAging=False and 0 that were NoAging=True. One would assume the the sum of these two filters should be the total of the items in the folder. Not so (obviously). Even more interestingly, if I iterated through each item in the collection (eg For Each itm in MyItems) and counted True vs False ofr the NoAging property, I ended up with 69 messages that returned False and 0 that returned True (which is the correct result). From what I can glean from these groups and other sources, all items support the NoAging property but it does not necessarily exist on all items. So where you are looking at the item itself, if the property doesn't exist the value defaults to False. When you are looking at the items collection, this doesnt happen so the Restrict method will not return items that do not have the property. So, the way to get the Restrict filter to acknowledge these messages that do not have a NoAging property is to set the filter as: "NoAging=False OR (NoAgingFalse AND NoAgingTrue)" This correctly returns the number of items in the collection that are NOT set to TRUE. (ie: those items NOT set to "Do Not Archive"). |
Ads |
#2
|
|||
|
|||
![]()
Am 23 Oct 2006 06:54:10 -0700 schrieb Greg J:
That´s very interesting, thank you. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Hi there, I am not looking for resolution, in fact I have found something I wish to share. Perhaps some of the experts might be able to validate it or even provide the reasons why. I have seen a couple of posts here hinting at this problem but from what I can see, it wasnt resolved. I have been trying to get my app to correctly determine the number of Items in a folder that have their NoAging property set to False, or more accurately, Not set to True (as I wish to ignore the items that are set as "Do Not Archive". NoAging=True means "Do Not Archive"). Interestingly, I ran into the problem where the Restrict method of the items collection was returning the incorrect number of items when I set NoAging=False. For example, in my Inbox, there were 69 messages, the Restrict filter returned 38 that were NoAging=False and 0 that were NoAging=True. One would assume the the sum of these two filters should be the total of the items in the folder. Not so (obviously). Even more interestingly, if I iterated through each item in the collection (eg For Each itm in MyItems) and counted True vs False ofr the NoAging property, I ended up with 69 messages that returned False and 0 that returned True (which is the correct result). From what I can glean from these groups and other sources, all items support the NoAging property but it does not necessarily exist on all items. So where you are looking at the item itself, if the property doesn't exist the value defaults to False. When you are looking at the items collection, this doesnt happen so the Restrict method will not return items that do not have the property. So, the way to get the Restrict filter to acknowledge these messages that do not have a NoAging property is to set the filter as: "NoAging=False OR (NoAgingFalse AND NoAgingTrue)" This correctly returns the number of items in the collection that are NOT set to TRUE. (ie: those items NOT set to "Do Not Archive"). |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help: The name could not be resolved... | Mike Cello | Outlook - General Queries | 1 | October 14th 06 03:56 PM |
Outlook connect to Exchange get name resolved error | Albert Wang | Outlook - General Queries | 0 | September 5th 06 07:14 PM |
Outlook connect to Exchange get name resolved error | Albert Wang | Outlook - General Queries | 2 | September 5th 06 07:05 PM |
MAPI32.DLL error resolved (maybe) | Johnny | Outlook - Installation | 0 | June 13th 06 12:45 AM |
Restrict | jim | Add-ins for Outlook | 2 | January 13th 06 08:14 PM |