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

Customize Task view on to-do bar programatically



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 1st 08, 03:29 PM posted to microsoft.public.outlook.program_vba
Ryan Taylor
external usenet poster
 
Posts: 9
Default Customize Task view on to-do bar programatically

Hello,

I am in the process of creating new Views in Outlook 2007 (C#, VSTO 2008)
and one criteria is to display the Icon property for tasks in both to the
Task Pane, and the To-do Bar.

I am able to programatically create new Views that work perfectly in the
Task Pane, however, I have been unable to figure out how to programmatically
modify the view used in the to-do bar. If any one can point me in the right
direction, I would greatly appreciate it as all I would like to do is add the
Icon property.

Thanks,
Ryan Taylor
Ads
  #2  
Old May 1st 08, 03:57 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Customize Task view on to-do bar programatically

The To-Do Bar is actually a view of a search folder. The search folder,
To-Do Search, is stored under the Store.RootFolder. You can access it using
this code (assuming you want to get at the To-Do Search folder in the
default Store and "ns" is a NameSpace object:

Outlook.Store defaultStore =
ns.GetDefaultFolder(Outlook.OlDefaultFolder.olFold erInbox).Store;

Outlook.Folder toDo =
defaultStore.GetSpecialFolder(Outlook.OlSpecialFol ders.olSpecialFolderAllTasks);

From there you can access the Views collection of the folder and proceed
normally.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hello,

I am in the process of creating new Views in Outlook 2007 (C#, VSTO 2008)
and one criteria is to display the Icon property for tasks in both to the
Task Pane, and the To-do Bar.

I am able to programatically create new Views that work perfectly in the
Task Pane, however, I have been unable to figure out how to
programmatically
modify the view used in the to-do bar. If any one can point me in the
right
direction, I would greatly appreciate it as all I would like to do is add
the
Icon property.

Thanks,
Ryan Taylor


  #3  
Old May 1st 08, 05:57 PM posted to microsoft.public.outlook.program_vba
Ryan Taylor
external usenet poster
 
Posts: 9
Default Customize Task view on to-do bar programatically

Hi Ken,

Thank you for your quick reply. I tried what you suggested however it
didn't seem to work. I have included the relevant portion of code below, if
you could take a look at it and what I might have missed from your sample, I
would greatly appreciate it.

I am basically just analyzing the current view of the to-do bar and if it
doesn't have the Icon property, trying to add it. I noticed that it WILL add
the icon to the to-list view that you can choose from the task pane, however
it does not seem to add it to the view showing on the to-do bar.


Code
=============
public void somemethod()
{
Folder inboxFolder =
_app.Session.GetDefaultFolder(OlDefaultFolders.olF olderInbox) as Folder;
Folder todoBarFolder =
inboxFolder.Store.GetSpecialFolder(OlSpecialFolder s.olSpecialFolderAllTasks)
as Folder;
EnsureIcon(todoBarFolder);
}

private void EnsureIcon(Folder todoBarFolder)
{
TableView view = todoBarFolder.CurrentView as TableView;
bool containsIcon = false;
foreach (object o in view.ViewFields)
{
ViewField field = o as ViewField;
if (field == null)
continue;
if (field.ViewXMLSchemaName.Equals(ICON_NAME,
StringComparison.InvariantCultureIgnoreCase))
{
containsIcon = true;
break;
}
}
if (!containsIcon)
{
view.ViewFields.Insert(ICON_NAME, 1);
view.Save();
}
}
=============

The biggest difference that I see from your code and mine is that I am using
_app.Session, instead of going through the namespace, but I tried both and it
didn't seem to make a difference.

Thanks,
Ryan

"Ken Slovak - [MVP - Outlook]" wrote:

The To-Do Bar is actually a view of a search folder. The search folder,
To-Do Search, is stored under the Store.RootFolder. You can access it using
this code (assuming you want to get at the To-Do Search folder in the
default Store and "ns" is a NameSpace object:

Outlook.Store defaultStore =
ns.GetDefaultFolder(Outlook.OlDefaultFolder.olFold erInbox).Store;

Outlook.Folder toDo =
defaultStore.GetSpecialFolder(Outlook.OlSpecialFol ders.olSpecialFolderAllTasks);

From there you can access the Views collection of the folder and proceed
normally.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hello,

I am in the process of creating new Views in Outlook 2007 (C#, VSTO 2008)
and one criteria is to display the Icon property for tasks in both to the
Task Pane, and the To-do Bar.

I am able to programatically create new Views that work perfectly in the
Task Pane, however, I have been unable to figure out how to
programmatically
modify the view used in the to-do bar. If any one can point me in the
right
direction, I would greatly appreciate it as all I would like to do is add
the
Icon property.

Thanks,
Ryan Taylor



  #4  
Old May 1st 08, 08:20 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Customize Task view on to-do bar programatically

I guess it all depends on the view itself. I was able to use similar code to
add ReminderTime to the ToDo Bar view, but even though the field is now
there in the view XML and ViewProperties collection it doesn't show up in
the view itself in the UI. The ToDo Bar has some formatting that's on it
that's very hard to change. It has that Arrange By and other things that
prevent some data from showing up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hi Ken,

Thank you for your quick reply. I tried what you suggested however it
didn't seem to work. I have included the relevant portion of code below,
if
you could take a look at it and what I might have missed from your sample,
I
would greatly appreciate it.

I am basically just analyzing the current view of the to-do bar and if it
doesn't have the Icon property, trying to add it. I noticed that it WILL
add
the icon to the to-list view that you can choose from the task pane,
however
it does not seem to add it to the view showing on the to-do bar.


Code
=============
public void somemethod()
{
Folder inboxFolder =
_app.Session.GetDefaultFolder(OlDefaultFolders.olF olderInbox) as Folder;
Folder todoBarFolder =
inboxFolder.Store.GetSpecialFolder(OlSpecialFolder s.olSpecialFolderAllTasks)
as Folder;
EnsureIcon(todoBarFolder);
}

private void EnsureIcon(Folder todoBarFolder)
{
TableView view = todoBarFolder.CurrentView as TableView;
bool containsIcon = false;
foreach (object o in view.ViewFields)
{
ViewField field = o as ViewField;
if (field == null)
continue;
if (field.ViewXMLSchemaName.Equals(ICON_NAME,
StringComparison.InvariantCultureIgnoreCase))
{
containsIcon = true;
break;
}
}
if (!containsIcon)
{
view.ViewFields.Insert(ICON_NAME, 1);
view.Save();
}
}
=============

The biggest difference that I see from your code and mine is that I am
using
_app.Session, instead of going through the namespace, but I tried both and
it
didn't seem to make a difference.

Thanks,
Ryan


  #5  
Old May 1st 08, 08:41 PM posted to microsoft.public.outlook.program_vba
Ryan Taylor
external usenet poster
 
Posts: 9
Default Customize Task view on to-do bar programatically

Hi Ken,

It sounds like your results were similar to mine. It seems like we just
aren't getting the correct view, it seems like the view the To-do bar is
using ia view from somewhere else even though it has the same name as the
other view. We are able to manually add the icon property by right clicking
on the header (for example: right click on the Arrange by column) and
choosing "Custom...". However, a major peice of this project is showing the
icons for the task, specifically in the to-do bar, so I need to be able to
make sure I can show them without depending on the user to manually go
through the process. Can you think of anything else that we can try?

Thanks again for your help, it is greatly appreciated.

Best Regards,
Ryan Taylor

"Ken Slovak - [MVP - Outlook]" wrote:

I guess it all depends on the view itself. I was able to use similar code to
add ReminderTime to the ToDo Bar view, but even though the field is now
there in the view XML and ViewProperties collection it doesn't show up in
the view itself in the UI. The ToDo Bar has some formatting that's on it
that's very hard to change. It has that Arrange By and other things that
prevent some data from showing up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hi Ken,

Thank you for your quick reply. I tried what you suggested however it
didn't seem to work. I have included the relevant portion of code below,
if
you could take a look at it and what I might have missed from your sample,
I
would greatly appreciate it.

I am basically just analyzing the current view of the to-do bar and if it
doesn't have the Icon property, trying to add it. I noticed that it WILL
add
the icon to the to-list view that you can choose from the task pane,
however
it does not seem to add it to the view showing on the to-do bar.


Code
=============
public void somemethod()
{
Folder inboxFolder =
_app.Session.GetDefaultFolder(OlDefaultFolders.olF olderInbox) as Folder;
Folder todoBarFolder =
inboxFolder.Store.GetSpecialFolder(OlSpecialFolder s.olSpecialFolderAllTasks)
as Folder;
EnsureIcon(todoBarFolder);
}

private void EnsureIcon(Folder todoBarFolder)
{
TableView view = todoBarFolder.CurrentView as TableView;
bool containsIcon = false;
foreach (object o in view.ViewFields)
{
ViewField field = o as ViewField;
if (field == null)
continue;
if (field.ViewXMLSchemaName.Equals(ICON_NAME,
StringComparison.InvariantCultureIgnoreCase))
{
containsIcon = true;
break;
}
}
if (!containsIcon)
{
view.ViewFields.Insert(ICON_NAME, 1);
view.Save();
}
}
=============

The biggest difference that I see from your code and mine is that I am
using
_app.Session, instead of going through the namespace, but I tried both and
it
didn't seem to make a difference.

Thanks,
Ryan



  #6  
Old May 2nd 08, 12:48 AM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Customize Task view on to-do bar programatically

Well, I've had limited success in customizing views of almost any type of
search folder in the past, and the To-Do Bar is just a view into a search
folder. I haven't spent a lot of time on it though, if I have any time
tomorrow I'll play around with it for a while.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hi Ken,

It sounds like your results were similar to mine. It seems like we just
aren't getting the correct view, it seems like the view the To-do bar is
using ia view from somewhere else even though it has the same name as the
other view. We are able to manually add the icon property by right
clicking
on the header (for example: right click on the Arrange by column) and
choosing "Custom...". However, a major peice of this project is showing
the
icons for the task, specifically in the to-do bar, so I need to be able to
make sure I can show them without depending on the user to manually go
through the process. Can you think of anything else that we can try?

Thanks again for your help, it is greatly appreciated.

Best Regards,
Ryan Taylor


  #7  
Old May 3rd 08, 04:02 AM posted to microsoft.public.outlook.program_vba
Ryan Taylor
external usenet poster
 
Posts: 9
Default Customize Task view on to-do bar programatically

Thanks Ken, it would be really great if you are able to find something.

Thanks,
Ryan

"Ken Slovak - [MVP - Outlook]" wrote:

Well, I've had limited success in customizing views of almost any type of
search folder in the past, and the To-Do Bar is just a view into a search
folder. I haven't spent a lot of time on it though, if I have any time
tomorrow I'll play around with it for a while.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hi Ken,

It sounds like your results were similar to mine. It seems like we just
aren't getting the correct view, it seems like the view the To-do bar is
using ia view from somewhere else even though it has the same name as the
other view. We are able to manually add the icon property by right
clicking
on the header (for example: right click on the Arrange by column) and
choosing "Custom...". However, a major peice of this project is showing
the
icons for the task, specifically in the to-do bar, so I need to be able to
make sure I can show them without depending on the user to manually go
through the process. Can you think of anything else that we can try?

Thanks again for your help, it is greatly appreciated.

Best Regards,
Ryan Taylor



  #8  
Old May 5th 08, 03:28 PM posted to microsoft.public.outlook.program_vba
Ryan Taylor
external usenet poster
 
Posts: 9
Default Customize Task view on to-do bar programatically

Hi Ken,

I was wondering if you had any luck with getting other fields (namely the
icon) to show up on the to-do bar programmatically?

Thanks,
Ryan


"Ryan Taylor" wrote:

Thanks Ken, it would be really great if you are able to find something.

Thanks,
Ryan

"Ken Slovak - [MVP - Outlook]" wrote:

Well, I've had limited success in customizing views of almost any type of
search folder in the past, and the To-Do Bar is just a view into a search
folder. I haven't spent a lot of time on it though, if I have any time
tomorrow I'll play around with it for a while.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hi Ken,

It sounds like your results were similar to mine. It seems like we just
aren't getting the correct view, it seems like the view the To-do bar is
using ia view from somewhere else even though it has the same name as the
other view. We are able to manually add the icon property by right
clicking
on the header (for example: right click on the Arrange by column) and
choosing "Custom...". However, a major peice of this project is showing
the
icons for the task, specifically in the to-do bar, so I need to be able to
make sure I can show them without depending on the user to manually go
through the process. Can you think of anything else that we can try?

Thanks again for your help, it is greatly appreciated.

Best Regards,
Ryan Taylor



  #9  
Old May 5th 08, 03:53 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Customize Task view on to-do bar programatically

No luck at all.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hi Ken,

I was wondering if you had any luck with getting other fields (namely the
icon) to show up on the to-do bar programmatically?

Thanks,
Ryan


  #10  
Old May 5th 08, 04:04 PM posted to microsoft.public.outlook.program_vba
Ryan Taylor
external usenet poster
 
Posts: 9
Default Customize Task view on to-do bar programatically

Fair enough, thanks for all of the time you spent looking. I wasn't able to
find anything either. Do you know what other otions I have in terms of
finding a solution to this problem?

Thanks,
Ryan


"Ken Slovak - [MVP - Outlook]" wrote:

No luck at all.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ryan Taylor" wrote in message
...
Hi Ken,

I was wondering if you had any luck with getting other fields (namely the
icon) to show up on the to-do bar programmatically?

Thanks,
Ryan



 




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
How to customize the Task Request form econ Outlook - Using Forms 0 May 14th 07 09:42 PM
Can I customize the day view in 2007? [email protected] Outlook - Calandaring 1 February 26th 07 08:17 PM
Customize Day View E-Coder Outlook - Calandaring 1 January 5th 07 01:58 AM
Customize Current View in OL 03 Bob S Outlook - General Queries 0 July 4th 06 11:37 PM
How to customize Views programatically? Lucas Campos Outlook and VBA 8 May 31st 06 04:48 PM


All times are GMT +1. The time now is 05:13 PM.


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.