![]() |
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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
Wow! That works like a charm! Thanks a lot!
![]() 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
|
|||
|
|||
![]()
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! ![]() 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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
Thanks a lot, guys! Seems easy now
![]() |
#7
|
|||
|
|||
![]()
What should be the scope for searching recursivelly in all personal
folders? |
#8
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |