Folder Restriction 
Author Message
 Folder Restriction

If I have 5 items in outlook which have the following subjects (No 5
being empty)
1 apple
2 has apple
3 apple is
4 something
5

If I do the following it only returns item 1

s = "[Subject] = """ & "Apple" & """"
for each I in Application.ActiveExplorer.CurrentFolder.Items.Restrict(s)
    debug.print I
next

But what I am expecting to be returned items 1 2 and 3 but not 4 and 5

This is restricting a folder.

Outlook view control Restriction: -
It can't be used, needs to be a folder restriction so the information
can be put into an array - folder it self can't be but values can
With the outlook view control the restriction works like (quote from
net):

Quote:
>Note that = is not interpreted for string comparisons as "equals",
but
>rather as "contains," so that "[Subject] = 'Outlook'" matches all
items that
>have "Outlook" or "outlook" anywhere in the Subject field. To create
a true
>equality filter, you must use <= and >= together, as in this example.

but with folder restriction it;s not the case - see eg above


Thanks



Sun, 16 Oct 2005 11:05:55 GMT  
 Folder Restriction
The Restrict and Find methods require an exact match. They do not support a "Like" operator. If you are using Outlook 2002, you can use the advanced Search object and a DASL filter.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming: Jumpstart
     for Administrators, Power Users, and Developers
     http://www.slipstick.com/books/jumpstart.htm

Quote:

> If I have 5 items in outlook which have the following subjects (No 5
> being empty)
> 1 apple
> 2 has apple
> 3 apple is
> 4 something
> 5

> If I do the following it only returns item 1

> s = "[Subject] = """ & "Apple" & """"
> for each I in Application.ActiveExplorer.CurrentFolder.Items.Restrict(s)
>     debug.print I
> next

> But what I am expecting to be returned items 1 2 and 3 but not 4 and 5

> This is restricting a folder.



Sun, 16 Oct 2005 19:56:53 GMT  
 Folder Restriction
Next version of Redemption (3.3) will support all kinds of searches
accessible in Extended MAPI, including the substring search, bit match, etc.
Contact me via the private e-mail if you want a copy of the beta.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> If I have 5 items in outlook which have the following subjects (No 5
> being empty)
> 1 apple
> 2 has apple
> 3 apple is
> 4 something
> 5

> If I do the following it only returns item 1

> s = "[Subject] = """ & "Apple" & """"
> for each I in Application.ActiveExplorer.CurrentFolder.Items.Restrict(s)
>     debug.print I
> next

> But what I am expecting to be returned items 1 2 and 3 but not 4 and 5

> This is restricting a folder.

> Outlook view control Restriction: -
> It can't be used, needs to be a folder restriction so the information
> can be put into an array - folder it self can't be but values can
> With the outlook view control the restriction works like (quote from
> net):

> >Note that = is not interpreted for string comparisons as "equals",
> but
> >rather as "contains," so that "[Subject] = 'Outlook'" matches all
> items that
> >have "Outlook" or "outlook" anywhere in the Subject field. To create
> a true
> >equality filter, you must use <= and >= together, as in this example.

> but with folder restriction it;s not the case - see eg above


> Thanks



Mon, 17 Oct 2005 00:39:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Public Folder home page with Outlook View Control and Restriction problem

2. Folder's restrictions

3. folder in a folder in a folder...

4. Build XML of folders, sub folders and files from specified folder

5. Determining if a folder is a local pst folder or a imap (server folder)

6. How to delete folders/files within a folder but not the folder itself

7. Restrictions in Expression Builder

8. (Q) Field Size restrictions in Crosstab query

9. HOWTO: Restriction [DueDate] = 'Jan 1, 4501'

10. Problem searching Outlook contacts w/new security restrictions

11. restriction on combox and form

12. Restriction Method

 

 
Powered by phpBB® Forum Software