You can only create a search folder for an e-mail folder in Outlook 2007 and in Outlook 2003

Article translations Article translations
Article ID: 817890 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

When you try to create a new search folder, you can only create a search folder for an e-mail folder. For example, you cannot create a search folder in the Calendar folder.

CAUSE

This behavior occurs because you can only create a search folder for e-mail folders when you use the menu method to create the search folder in Microsoft Office Outlook 2007 and in Microsoft Office Outlook 2003.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMSImportant Note This method of creating a new search folder is not a supported method and is at your own risk.

To work around this behavior, you must create a macro solution if you want to create a new search folder in a folder other than an e-mail folder. For example, to create a new search folder for the Calendar folder, create a Microsoft Visual Basic for Applications macro similar to the following sample macro:

Sub CreateNewSearchFolder()

   Dim objSch As Search

   'Create a folder that shows all recurring calendar items
   Dim strF As String
   strF = "http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/8223000b=1"

   Dim strS As String
   strS = "Calendar"

   Dim strTag As String
   strTag = "RecurSearch"

   Set objSch = Application.AdvancedSearch(Scope:=strS, Filter:=strF, _
      SearchSubFolders:=True, Tag:=strTag)

   If objSch Is Nothing Then
      MsgBox "Sorry, the search folder could not be created."
   End If

   objSch.Save ("MyCal") 'Change MyCal to the search folder you want to create
 
End Sub

MORE INFORMATION

Microsoft Outlook uses folders to contain collections of data. An Outlook folder contains items such as your new e-mail messages (Inbox), sent e-mail messages (Sent Items), or e-mail messages that you want to save are stored. E-mail messages are not stored in search folders. Search folders are virtual folders that contain views of all e-mail items that matches specific search criteria.

Properties

Article ID: 817890 - Last Review: February 1, 2007 - Revision: 3.4
APPLIES TO
  • Microsoft Office Outlook 2007
  • Microsoft Office Outlook 2003
Keywords: 
kbvba kbprogramming kbnofix kbprb KB817890

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com