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 - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Custom Search Folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 18th 06, 10:59 AM posted to microsoft.public.outlook
[email protected]
external usenet poster
 
Posts: 4
Default Custom Search Folder

Hi!

I would like to know if there is any way to programatically create
your own custom Search Folder from an Outlook add-in, and of course,
add it's own search criteria (I would like to search after a custom
fileld added in certain MailItems). Also, if this is possible, how do I
access it afterwards?
It doesn't matter if this is done via OOM, CDO or Redemption (or
something else?)...is it possible?

Thanks a lot,
Doru

Ads
  #2  
Old April 18th 06, 01:22 PM posted to microsoft.public.outlook
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Custom Search Folder

Use the Application.AdvancedSearch method to return a Search object, then use Search.Save to create the search folder. You will be able to use a custom field in the search criteria only if it is defined in the folder(s), not just in individual items.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm....program_v ba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message oups.com...
Hi!

I would like to know if there is any way to programatically create
your own custom Search Folder from an Outlook add-in, and of course,
add it's own search criteria (I would like to search after a custom
fileld added in certain MailItems). Also, if this is possible, how do I
access it afterwards?
It doesn't matter if this is done via OOM, CDO or Redemption (or
something else?)...is it possible?

Thanks a lot,
Doru

  #3  
Old April 18th 06, 03:21 PM posted to microsoft.public.outlook
[email protected]
external usenet poster
 
Posts: 4
Default Custom Search Folder

Wow! That works like a charm! Thanks a lot! I can now create my own
Search Folder, but I still don't understand if, and how can I:
1) programatically find it,
2) edit it if needed (i.e. if the user manually modified it in the
mean time),
3) eventually delete it (will be needed on add-in uninstall).

Thanks again,
Doru

  #4  
Old April 18th 06, 09:10 PM posted to microsoft.public.outlook
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Custom Search Folder

Since the Search.Save function returns a MAPIFolder object, you should be able to get that folder's EntryID at that point for later use with the Namespace.GetFolderFromID method.

You will not be able to edit the search folder settings programmatically. I think you'll be able to delete it, but I haven't tried it.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message ups.com...
Wow! That works like a charm! Thanks a lot! I can now create my own
Search Folder, but I still don't understand if, and how can I:
1) programatically find it,
2) edit it if needed (i.e. if the user manually modified it in the
mean time),
3) eventually delete it (will be needed on add-in uninstall).

Thanks again,
Doru

  #5  
Old April 19th 06, 12:07 AM posted to microsoft.public.outlook
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Custom Search Folder

Yeah, you have to get it, delete it and then re-create it if you want to
change the filter. I've done that a lot.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Sue Mosher [MVP-Outlook]" wrote in message
...
Since the Search.Save function returns a MAPIFolder object, you should be
able to get that folder's EntryID at that point for later use with the
Namespace.GetFolderFromID method.

You will not be able to edit the search folder settings programmatically. I
think you'll be able to delete it, but I haven't tried it.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


  #6  
Old April 19th 06, 09:58 AM posted to microsoft.public.outlook
[email protected]
external usenet poster
 
Posts: 4
Default Custom Search Folder

Thanks a lot, guys! Seems easy now

  #7  
Old April 19th 06, 01:02 PM posted to microsoft.public.outlook
CrystY
external usenet poster
 
Posts: 1
Default Custom Search Folder

What should be the scope for searching recursivelly in all personal
folders?

  #8  
Old April 19th 06, 02:41 PM posted to microsoft.public.outlook
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Custom Search Folder

You can't set up a searchfolder that searches across multiple mail stores
(PST files or Exchange mailboxes). Each searchfolder can only search within
its own store.

For a search of a PST file that starts with the top of store and includes
all subfolders use a search string something like this (depending on the
name of your top of store):

strSearch = "'//Personal Folders'"

Note that since there's a space in "Personal Folders" I surrounded it with
single quotes.

Then you would set the SearchSubfolders argument = True.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"CrystY" wrote in message
oups.com...
What should be the scope for searching recursivelly in all personal
folders?


  #9  
Old April 19th 06, 03:35 PM posted to microsoft.public.outlook
[email protected]
external usenet poster
 
Posts: 4
Default Custom Search Folder

This all works fine, but how can I programatically save my search
folder in a DIFFERENT store then the default one (i.e. Personal
Folders). Probably it's the name parameter in the Save method of the
search object - search_object.Save("name_here"), but I just can't
figure it out.
Thanks!

  #10  
Old April 19th 06, 04:08 PM posted to microsoft.public.outlook
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Custom Search Folder

You can't. Search folders are not actual MAPI folders. They are stored search queries and live in the default store as hidden items.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message oups.com...
This all works fine, but how can I programatically save my search
folder in a DIFFERENT store then the default one (i.e. Personal
Folders). Probably it's the name parameter in the Save method of the
search object - search_object.Save("name_here"), but I just can't
figure it out.
Thanks!

 




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
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 09:40 AM
Search Folder Question Please Bob Newman Outlook - General Queries 0 April 2nd 06 03:34 PM
search custom fields student of science Outlook - Using Forms 2 March 22nd 06 04:28 PM
Which folder is the message in after search? Gregg Hill Outlook - General Queries 2 March 1st 06 07:50 AM
Help me setup this custom search [email protected] Outlook - General Queries 0 January 23rd 06 05:18 PM


All times are GMT +1. The time now is 06:13 AM.


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.