![]() |
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |