<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using Search Folders in Outlook 2007 for GTD</title>
	<atom:link href="http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/feed/" rel="self" type="application/rss+xml" />
	<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-search-folders-in-outlook-2007-for-gtd</link>
	<description>The only person allowed to login as &#039;guest&#039;</description>
	<lastBuildDate>Mon, 23 Jan 2012 07:14:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Solution to using Outlook 2010 for GTD &#171; The Trusted Adviser</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-260</link>
		<dc:creator>Solution to using Outlook 2010 for GTD &#171; The Trusted Adviser</dc:creator>
		<pubDate>Tue, 19 Apr 2011 15:53:01 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-260</guid>
		<description>[...] sourcecode I learned from SimonGuest.com blog and added in some automations to make it easy for everyone to use. I will improve the sourcecode [...] </description>
		<content:encoded><![CDATA[<p>[...] sourcecode I learned from SimonGuest.com blog and added in some automations to make it easy for everyone to use. I will improve the sourcecode [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Lim</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-259</link>
		<dc:creator>Ryan Lim</dc:creator>
		<pubDate>Wed, 13 Apr 2011 17:06:45 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-259</guid>
		<description>I am using Outlook 2010 and window 7. I had the same problem with Run-time error’-2147024809 (80070057)’. I spend the whole day on 14/4/2011 to google, read through all the material I can find, read up 2x programming books on outlook I had and came to the conclusion that the error came from

   taskFilter = &quot;(&quot;&quot;http://schemas.microsoft.com/mapi/proptag/0×0e05001f&quot;&quot;= ‘Tasks’ AND &quot;&quot;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&quot;&quot;  2) OR (NOT(&quot;&quot;http://schemas.microsoft.com/mapi/proptag/0×10900003&quot;&quot; IS NULL) AND &quot;&quot;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&quot;&quot;  2)&quot; 

The most likely cause is the proptag which may have changed. I am NOT too familiar with DASL filters used in the Outlook AdvancedSearch method used, so maybe I was wrong.

Solution:
I found that in outlook 2010 you can add a filter tab to the ribbon and add a query by editing the registry. It may also be possible to use the advanced tab when using this filter and then look at the SQL generated. For example, see these two picture and see that the SQL syntax is very similar to thetaskFilter above.

http://imgur.com/SMTdx

http://imgur.com/XAaaw

My Code
-------------
I modified the code based on searches at MSDN and simonguest code. This code will only create searchfolder for tasks with category you type in. You can easily modify it to create searchfolder for mails with category too. I am still working on this and when I master the DASL filtes used, I will improve the codes for more power and user friendliness so do check future posts down the line.

Sub CreateNewSearchFolder()
    
    &#039;Create a New SearchFolder for tasks
    &#039;This only work if you paste the code in ThisOutlookSession, if you paste it to Modules, then application and namespace need to be program in

    Dim objSearch As Search
    Dim strFilter As String
    Dim strScope As String
    Dim strTag As String
    Dim strFolderName As String
    Dim strCategoryFilter As String
    
    strFolderName = InputBox(&quot;What category would you like to create a search folder for?:&quot;, &quot;Category&quot;)
    strCategoryFilter = &quot;(&quot;&quot;urn:schemas-microsoft-com:office:office#Keywords&quot;&quot; LIKE &#039;%&quot; &amp; strFolderName &amp; &quot;%&#039;)&quot;
    
    strScope = &quot;&#039;&quot; &amp; Application.Session.GetDefaultFolder(olFolderTasks).FolderPath &amp; &quot;&#039;&quot;

    strFilter = &quot;(&quot;&quot;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&quot;&quot; = 0)&quot;
    strTag = &quot;RecurSearch&quot;
    
    Set objSearch = Application.AdvancedSearch(Scope:=strScope, Filter:=strCategoryFilter &amp; &quot; AND (&quot; + strFilter + &quot;)&quot;, SearchSubFolders:=True, Tag:=strTag)

    If objSearch Is Nothing Then
        MsgBox &quot;Sorry, the search folder could not be created.&quot;
    End If

    objSearch.Save (strFolderName)
 
End Sub</description>
		<content:encoded><![CDATA[<p>I am using Outlook 2010 and window 7. I had the same problem with Run-time error’-2147024809 (80070057)’. I spend the whole day on 14/4/2011 to google, read through all the material I can find, read up 2x programming books on outlook I had and came to the conclusion that the error came from</p>
<p>   taskFilter = &#8220;(&#8220;&#8221;http://schemas.microsoft.com/mapi/proptag/0×0e05001f&#8221;"= ‘Tasks’ AND &#8220;&#8221;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&#8243;&#8221;  2) OR (NOT(&#8220;&#8221;http://schemas.microsoft.com/mapi/proptag/0×10900003&#8243;&#8221; IS NULL) AND &#8220;&#8221;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&#8243;&#8221;  2)&#8221; </p>
<p>The most likely cause is the proptag which may have changed. I am NOT too familiar with DASL filters used in the Outlook AdvancedSearch method used, so maybe I was wrong.</p>
<p>Solution:<br />
I found that in outlook 2010 you can add a filter tab to the ribbon and add a query by editing the registry. It may also be possible to use the advanced tab when using this filter and then look at the SQL generated. For example, see these two picture and see that the SQL syntax is very similar to thetaskFilter above.</p>
<p><a href="http://imgur.com/SMTdx" rel="nofollow">http://imgur.com/SMTdx</a></p>
<p><a href="http://imgur.com/XAaaw" rel="nofollow">http://imgur.com/XAaaw</a></p>
<p>My Code<br />
&#8212;&#8212;&#8212;&#8212;-<br />
I modified the code based on searches at MSDN and simonguest code. This code will only create searchfolder for tasks with category you type in. You can easily modify it to create searchfolder for mails with category too. I am still working on this and when I master the DASL filtes used, I will improve the codes for more power and user friendliness so do check future posts down the line.</p>
<p>Sub CreateNewSearchFolder()</p>
<p>    &#8216;Create a New SearchFolder for tasks<br />
    &#8216;This only work if you paste the code in ThisOutlookSession, if you paste it to Modules, then application and namespace need to be program in</p>
<p>    Dim objSearch As Search<br />
    Dim strFilter As String<br />
    Dim strScope As String<br />
    Dim strTag As String<br />
    Dim strFolderName As String<br />
    Dim strCategoryFilter As String</p>
<p>    strFolderName = InputBox(&#8220;What category would you like to create a search folder for?:&#8221;, &#8220;Category&#8221;)<br />
    strCategoryFilter = &#8220;(&#8220;&#8221;urn:schemas-microsoft-com:office:office#Keywords&#8221;" LIKE &#8216;%&#8221; &amp; strFolderName &amp; &#8220;%&#8217;)&#8221;</p>
<p>    strScope = &#8220;&#8216;&#8221; &amp; Application.Session.GetDefaultFolder(olFolderTasks).FolderPath &amp; &#8220;&#8216;&#8221;</p>
<p>    strFilter = &#8220;(&#8220;&#8221;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&#8243;&#8221; = 0)&#8221;<br />
    strTag = &#8220;RecurSearch&#8221;</p>
<p>    Set objSearch = Application.AdvancedSearch(Scope:=strScope, Filter:=strCategoryFilter &amp; &#8221; AND (&#8221; + strFilter + &#8220;)&#8221;, SearchSubFolders:=True, Tag:=strTag)</p>
<p>    If objSearch Is Nothing Then<br />
        MsgBox &#8220;Sorry, the search folder could not be created.&#8221;<br />
    End If</p>
<p>    objSearch.Save (strFolderName)</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bala</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-258</link>
		<dc:creator>Bala</dc:creator>
		<pubDate>Fri, 25 Mar 2011 12:22:48 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-258</guid>
		<description>Hi, 
Asking a question that went unanswered somewhere up there :)

I use Outlook 2007 in Cached Exchange mode and have a 900MB exchange server mailbox limit. I am required to move my mail to local PSTs if it approaches the limit.

Is there any way to create a Search folder that either:
1) Allows me to search my Exchange Inbox as well as my Local PST Inbox or
2) Contains results of multiple search folders from multiple PSTs and the Exchange Inbox.

Thanks a lot in advance!

Bala</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Asking a question that went unanswered somewhere up there <img src='http://simonguest.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I use Outlook 2007 in Cached Exchange mode and have a 900MB exchange server mailbox limit. I am required to move my mail to local PSTs if it approaches the limit.</p>
<p>Is there any way to create a Search folder that either:<br />
1) Allows me to search my Exchange Inbox as well as my Local PST Inbox or<br />
2) Contains results of multiple search folders from multiple PSTs and the Exchange Inbox.</p>
<p>Thanks a lot in advance!</p>
<p>Bala</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-257</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Tue, 08 Feb 2011 09:06:04 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-257</guid>
		<description>Hi,
Thanks for the tip and the vb code!

I am experiencing the same problem as Mike. I get the same error message as Mike (&quot;Run-time error -2147024809 Could not complete the operation. One or more parameter values are not valid&quot;). I am running Windows 7 and Office 2007 SP2. 

I&#039;d love to have this functionality. Any idea on how to fix it?

Aslak.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for the tip and the vb code!</p>
<p>I am experiencing the same problem as Mike. I get the same error message as Mike (&#8220;Run-time error -2147024809 Could not complete the operation. One or more parameter values are not valid&#8221;). I am running Windows 7 and Office 2007 SP2. </p>
<p>I&#8217;d love to have this functionality. Any idea on how to fix it?</p>
<p>Aslak.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-256</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 16 Sep 2010 14:41:59 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-256</guid>
		<description>I removed all of the breaks.  On the line that bombs: Set objSech = Application.AdvancedSearch........

My variables are:

?strs
’\Mailbox - John Doe’

?categoryfilter
(&quot;urn:schemas-microsoft-com:office:office#Keywords&quot; LIKE ‘%Stuff%’)

?taskfilter
(&quot;http://schemas.microsoft.com/mapi/proptag/0×0e05001f&quot;= ‘Tasks’ AND &quot;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&quot;  2) OR (NOT(&quot;http://schemas.microsoft.com/mapi/proptag/0×10900003&quot; IS NULL) AND &quot;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&quot;  2)

?strTag
RecurSearch


Not sure if any of this helps.</description>
		<content:encoded><![CDATA[<p>I removed all of the breaks.  On the line that bombs: Set objSech = Application.AdvancedSearch&#8230;&#8230;..</p>
<p>My variables are:</p>
<p>?strs<br />
’\Mailbox &#8211; John Doe’</p>
<p>?categoryfilter<br />
(&#8220;urn:schemas-microsoft-com:office:office#Keywords&#8221; LIKE ‘%Stuff%’)</p>
<p>?taskfilter<br />
(&#8220;http://schemas.microsoft.com/mapi/proptag/0×0e05001f&#8221;= ‘Tasks’ AND &#8220;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&#8243;  2) OR (NOT(&#8220;http://schemas.microsoft.com/mapi/proptag/0×10900003&#8243; IS NULL) AND &#8220;http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003&#8243;  2)</p>
<p>?strTag<br />
RecurSearch</p>
<p>Not sure if any of this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-255</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Thu, 16 Sep 2010 04:41:59 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-255</guid>
		<description>Is there any way to create a search folder for tasks without a catagory assigned?   I tried to leave the catagory blank but got 

Run-time error&#039;-2147024809 (80070057)&#039;:

Could not complete the operation. One or more parameter values are not valid.

(I often forget to catagorize tasks when I enter them on the smartphone and being able to see them in a similar way as the other search folders would be helpful.)

This post has become a cornerstone for my GTD setup.  Thanks for it.</description>
		<content:encoded><![CDATA[<p>Is there any way to create a search folder for tasks without a catagory assigned?   I tried to leave the catagory blank but got </p>
<p>Run-time error&#8217;-2147024809 (80070057)&#8217;:</p>
<p>Could not complete the operation. One or more parameter values are not valid.</p>
<p>(I often forget to catagorize tasks when I enter them on the smartphone and being able to see them in a similar way as the other search folders would be helpful.)</p>
<p>This post has become a cornerstone for my GTD setup.  Thanks for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-254</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Wed, 15 Sep 2010 05:36:35 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-254</guid>
		<description>Very odd - are all your line breaks OK?  If it&#039;s complaining about parameters not being valid, maybe one of the underscores went missing?</description>
		<content:encoded><![CDATA[<p>Very odd &#8211; are all your line breaks OK?  If it&#8217;s complaining about parameters not being valid, maybe one of the underscores went missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-253</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 14 Sep 2010 20:39:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-253</guid>
		<description>2007 SP2</description>
		<content:encoded><![CDATA[<p>2007 SP2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-252</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Wed, 08 Sep 2010 19:28:43 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-252</guid>
		<description>W7 shouldn&#039;t have changed anything.  What version of Office are you using with these?</description>
		<content:encoded><![CDATA[<p>W7 shouldn&#8217;t have changed anything.  What version of Office are you using with these?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://simonguest.com/2009/03/11/using-search-folders-in-outlook-2007-for-gtd/#comment-251</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 08 Sep 2010 15:15:10 +0000</pubDate>
		<guid isPermaLink="false">/blogs/smguest/archive/2009/03/11/Using-Search-Folders-in-Outlook-2007-for-GTD.aspx#comment-251</guid>
		<description>This worked great on my XP machine, but it won&#039;t run on W7.  I get an error on the Set objSch = Application.AdvancedSearch........ line

Run-time error -2147024809 Could not complete the operation. One or more parameter values are not valid.

Probably something in the categoryfilter or taskfilter.  Not sure if those schemas got changed in W7</description>
		<content:encoded><![CDATA[<p>This worked great on my XP machine, but it won&#8217;t run on W7.  I get an error on the Set objSch = Application.AdvancedSearch&#8230;&#8230;.. line</p>
<p>Run-time error -2147024809 Could not complete the operation. One or more parameter values are not valid.</p>
<p>Probably something in the categoryfilter or taskfilter.  Not sure if those schemas got changed in W7</p>
]]></content:encoded>
	</item>
</channel>
</rss>

