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

How to filter the Tasks Home Page???



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 15th 07, 06:45 AM posted to microsoft.public.outlook.program_vba
charan
external usenet poster
 
Posts: 3
Default How to filter the Tasks Home Page???

Hi,
I want to filter the Tasks home page based on some input criteria like
From This Start Date to That Date.
I found a way that by using Restrict() Method in OlTaskItem Object,we can
filter the data and it does.
But the problem for me is that i can't able to place the Filtered collection
Object in the Tasks Home page.
Either i can able to Open all the Filtered Tasks using Display Method or i
can use Delete Method to delete the he collection object and something else i
can do.
But my requirement is to just show only the filtered Task in the TAsks
Home PAge.
Can anyone help with this?
--
Any responce will be really appreciated.
Ads
  #2  
Old March 16th 07, 05:08 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How to filter the Tasks Home Page???


You can modify the folder's CurrentView property. The easiest way is to
create the filter via the wizard. Then read CurrentView.Xml and see how the
the filter node has to look like.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am Wed, 14 Mar 2007 23:45:00 -0700 schrieb Charan:

Hi,
I want to filter the Tasks home page based on some input criteria like
From This Start Date to That Date.
I found a way that by using Restrict() Method in OlTaskItem Object,we can
filter the data and it does.
But the problem for me is that i can't able to place the Filtered

collection
Object in the Tasks Home page.
Either i can able to Open all the Filtered Tasks using Display Method or i
can use Delete Method to delete the he collection object and something

else i
can do.
But my requirement is to just show only the filtered Task in the TAsks
Home PAge.
Can anyone help with this?

  #3  
Old March 16th 07, 05:33 AM posted to microsoft.public.outlook.program_vba
charan
external usenet poster
 
Posts: 3
Default How to filter the Tasks Home Page???

Hi Bauer,
Thanks for your response.But i need to give the input dynamically,based
on the input given by the User,Tasks should be filtered.Further this has be
done by my application(my VBA code) and not by the Outlook predefined Tasks
filter.

Here is my sample code.
Const olFolderTasks = 13

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderTasks)
Set objTask = objOutlook.CreateItem(olTaskItem)

Set colItems = objFolder.Items

strFilter = "[Subject] = 'qwe'"
Set coltasks = colItems.Restrict(strFilter)

For Each objTask In coltasks
objTask.Display
Next

Here instead of "objTask.Display" ,i need some other thing that should show
only the filtered Tasks.Since "objTask.Display" will "open" all the filtered
Tasks. I don't want to open the Tasks but to show the Tasks.
--
Thanks in advance.

"Michael Bauer [MVP - Outlook]" wrote:


You can modify the folder's CurrentView property. The easiest way is to
create the filter via the wizard. Then read CurrentView.Xml and see how the
the filter node has to look like.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am Wed, 14 Mar 2007 23:45:00 -0700 schrieb Charan:

Hi,
I want to filter the Tasks home page based on some input criteria like
From This Start Date to That Date.
I found a way that by using Restrict() Method in OlTaskItem Object,we can
filter the data and it does.
But the problem for me is that i can't able to place the Filtered

collection
Object in the Tasks Home page.
Either i can able to Open all the Filtered Tasks using Display Method or i
can use Delete Method to delete the he collection object and something

else i
can do.
But my requirement is to just show only the filtered Task in the TAsks
Home PAge.
Can anyone help with this?


  #4  
Old March 19th 07, 07:23 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How to filter the Tasks Home Page???



You have two options:

1) The Restrict method returns a filtered Items collection. With a UserForm
and a Listbox on it you can display the items.

2) Modifiy the CurrentView.Xml property. Outlook will show the result
directly itself.


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am Thu, 15 Mar 2007 22:33:00 -0700 schrieb Charan:

Hi Bauer,
Thanks for your response.But i need to give the input

dynamically,based
on the input given by the User,Tasks should be filtered.Further this has

be
done by my application(my VBA code) and not by the Outlook predefined

Tasks
filter.

Here is my sample code.
Const olFolderTasks = 13

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderTasks)
Set objTask = objOutlook.CreateItem(olTaskItem)

Set colItems = objFolder.Items

strFilter = "[Subject] = 'qwe'"
Set coltasks = colItems.Restrict(strFilter)

For Each objTask In coltasks
objTask.Display
Next

Here instead of "objTask.Display" ,i need some other thing that should

show
only the filtered Tasks.Since "objTask.Display" will "open" all the

filtered
Tasks. I don't want to open the Tasks but to show the Tasks.

 




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
Home page in Internet Explorer 7 Katherine Outlook Express 2 November 12th 06 03:59 PM
User cannot see public folder home page [email protected] Outlook - General Queries 1 October 14th 06 12:54 AM
adding hyperlinks to the folder home page indrajith_varma1 Outlook - General Queries 3 September 27th 06 11:56 PM
Excel as folder home page in Outlook2003 tee Outlook - General Queries 5 September 25th 06 01:11 PM
why does outlook 2003 go to my email home page jeff1202 Outlook - Installation 0 March 15th 06 12:01 AM


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