A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Setting Restrict for NoAging property, resolved



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 23rd 06, 02:54 PM posted to microsoft.public.outlook.program_vba
Greg J
external usenet poster
 
Posts: 8
Default Setting Restrict for NoAging property, resolved

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  
Old October 24th 06, 05:54 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Setting Restrict for NoAging property, resolved

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 02:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.