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

Creating a search folder using VBA



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 25th 08, 10:36 AM posted to microsoft.public.outlook.program_vba
Ebbe
external usenet poster
 
Posts: 1
Default 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


Ads
  #2  
Old July 25th 08, 02:51 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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


 




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
OL2007 Folder search similar to Vista Start Menu search? Dan Outlook - General Queries 7 January 25th 08 02:42 PM
Creating and naming a personal folder Mark Ivey Outlook and VBA 2 June 3rd 07 04:58 PM
Creating Outlook Search Folder Programatically. Elanchezhian.R Outlook and VBA 2 February 7th 07 07:09 AM
Creating a Folder Geoff_s Outlook Express 3 August 12th 06 01:50 AM
Create a search folder to look at all emails in one folder and selected criteria in other folders [email protected] Outlook - General Queries 1 April 10th 06 10:40 AM


All times are GMT +1. The time now is 08:57 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.