Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Creating a search folder using VBA (http://www.outlookbanter.com/outlook-vba/75768-creating-search-folder-using-vba.html)

Ebbe July 25th 08 09:36 AM

Creating a search folder using VBA
 
Hi

I have a problem creating the search folder I want.
Using the normal way of creating a search folder, it is possible to search
for mails where subject contains (or not contains) a specific string.
BUT as far as I can see, it is not possible to specify a criterie, that says
"Subject must (or must not) begin/end with string xxx".
There are also some complicated rules about who the mail is comming from og
is sendt to.

I have searched around but have not found any VBA code exambles showing, how
to evaluate a mail to decide whether the mail should be included in the
search folder or not.

Can any of You help me with some code og link to some?

Ebbe



Ken Slovak - [MVP - Outlook] July 25th 08 01:51 PM

Creating a search folder using VBA
 
The Web site www.outlookcode.com in general is an excellent resource.

Here's a tip on how to get the SQL/DASL syntax you need for something like a
search folder. Open the Customize Current View dialog and click the Filter
button. Set up a filter on the Advanced tab and after you add it the search
criteria for the filter look at the SQL tab.

For something like begins with or ends with you use the LIKE operator with
the "?" wildcard. So begins with "test" would look like this:

"urn:schemas:httpmail:subject" LIKE 'test%'

For ends with "test" it would look like this:

"urn:schemas:httpmail:subject" LIKE '%test'

For contains "test":

"urn:schemas:httpmail:subject" LIKE '%test%'

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ebbe" GF wrote in
message ...
Hi

I have a problem creating the search folder I want.
Using the normal way of creating a search folder, it is possible to search
for mails where subject contains (or not contains) a specific string.
BUT as far as I can see, it is not possible to specify a criterie, that
says "Subject must (or must not) begin/end with string xxx".
There are also some complicated rules about who the mail is comming from
og is sendt to.

I have searched around but have not found any VBA code exambles showing,
how to evaluate a mail to decide whether the mail should be included in
the search folder or not.

Can any of You help me with some code og link to some?

Ebbe




All times are GMT +1. The time now is 11:35 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-2006 OutlookBanter.com