![]() |
Remove Standard View in Outlook 2007?
i have created a custom MAPIFolder and would like to remove some of the
default views. I get a COM exception when I try this. Is this a bug in the Beta code or is it just not possible? here is my code: Outlook.Folder contactsFolder = (Outlook.Folder) this.Application.GetNamespace("MAPI").GetDefaultFo lder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Folder myFolder = (Outlook.Folder) contactsFolder.Add("MyFolder", System.Reflection.Missing.Value); myFolder.Views["By Location"].Delete(); |
Remove Standard View in Outlook 2007?
It is not possible to remove any of the standard views in any version of Outlook. What about setting Folder.CustomViewsOnly = True instead?
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Fidget Brain" wrote in message ... i have created a custom MAPIFolder and would like to remove some of the default views. I get a COM exception when I try this. Is this a bug in the Beta code or is it just not possible? here is my code: Outlook.Folder contactsFolder = (Outlook.Folder) this.Application.GetNamespace("MAPI").GetDefaultFo lder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Folder myFolder = (Outlook.Folder) contactsFolder.Add("MyFolder", System.Reflection.Missing.Value); myFolder.Views["By Location"].Delete(); |
Remove Standard View in Outlook 2007?
I don't see a Delete method in the Object Browser for Outlook 2007 for Views
(or in earlier versions of Outlook either). At least here it's the Remove method. If you're not sure about a method, property or event use the Object Browser. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Fidget Brain" wrote in message ... i have created a custom MAPIFolder and would like to remove some of the default views. I get a COM exception when I try this. Is this a bug in the Beta code or is it just not possible? here is my code: Outlook.Folder contactsFolder = (Outlook.Folder) this.Application.GetNamespace("MAPI").GetDefaultFo lder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Folder myFolder = (Outlook.Folder) contactsFolder.Add("MyFolder", System.Reflection.Missing.Value); myFolder.Views["By Location"].Delete(); |
Remove Standard View in Outlook 2007?
the preliminary Outlook 2007 developers documentation lists a Delete() and a
Remove() method. I have tried both of these methods in an attempt to remove a standard view from the collection. I am able to remove a custom view that I have added myself using these methods. However I am unable to remove a standard view because I get a COM error. The reason I am trying to do this is because I have set up a new NavigationPane folder based on a custom MAPI Folder that I have created. When a user clicks to insert a new item or edit an item from this MAPI Folder, the form region I am exposing replaces the default Contacts form and only user defined fields are visible. Urgo when a user clicks my navigation folder, I do not want to display a list of Views to a user that are based on the standard Outlook Contacts item. This does not make sense as my resulting form will not expose these fields, so why would they want to see them listed in its View?. Instead I want a customised Views list which shows only my user defined fields. it seems to me that if Microsoft are allowing developers to create form regions which completely override and customise the original Contacts form, then it follows that I would also need this for the Views on the navigation pane as well? this is a big sticking point for me as I cant seem to get info about how to solve this. I will try your suggestion Sue. any more suggestions/help from anybody would be greatly appreciated. "Ken Slovak - [MVP - Outlook]" wrote in message ... I don't see a Delete method in the Object Browser for Outlook 2007 for Views (or in earlier versions of Outlook either). At least here it's the Remove method. If you're not sure about a method, property or event use the Object Browser. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Fidget Brain" wrote in message ... i have created a custom MAPIFolder and would like to remove some of the default views. I get a COM exception when I try this. Is this a bug in the Beta code or is it just not possible? here is my code: Outlook.Folder contactsFolder = (Outlook.Folder) this.Application.GetNamespace("MAPI").GetDefaultFo lder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Folder myFolder = (Outlook.Folder) contactsFolder.Add("MyFolder", System.Reflection.Missing.Value); myFolder.Views["By Location"].Delete(); |
Remove Standard View in Outlook 2007?
sue
many thanks. the answer was right in front of me all this time. so sorry to have wasted you time. "Fidget Brain" wrote in message ... the preliminary Outlook 2007 developers documentation lists a Delete() and a Remove() method. I have tried both of these methods in an attempt to remove a standard view from the collection. I am able to remove a custom view that I have added myself using these methods. However I am unable to remove a standard view because I get a COM error. The reason I am trying to do this is because I have set up a new NavigationPane folder based on a custom MAPI Folder that I have created. When a user clicks to insert a new item or edit an item from this MAPI Folder, the form region I am exposing replaces the default Contacts form and only user defined fields are visible. Urgo when a user clicks my navigation folder, I do not want to display a list of Views to a user that are based on the standard Outlook Contacts item. This does not make sense as my resulting form will not expose these fields, so why would they want to see them listed in its View?. Instead I want a customised Views list which shows only my user defined fields. it seems to me that if Microsoft are allowing developers to create form regions which completely override and customise the original Contacts form, then it follows that I would also need this for the Views on the navigation pane as well? this is a big sticking point for me as I cant seem to get info about how to solve this. I will try your suggestion Sue. any more suggestions/help from anybody would be greatly appreciated. "Ken Slovak - [MVP - Outlook]" wrote in message ... I don't see a Delete method in the Object Browser for Outlook 2007 for Views (or in earlier versions of Outlook either). At least here it's the Remove method. If you're not sure about a method, property or event use the Object Browser. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Fidget Brain" wrote in message ... i have created a custom MAPIFolder and would like to remove some of the default views. I get a COM exception when I try this. Is this a bug in the Beta code or is it just not possible? here is my code: Outlook.Folder contactsFolder = (Outlook.Folder) this.Application.GetNamespace("MAPI").GetDefaultFo lder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Folder myFolder = (Outlook.Folder) contactsFolder.Add("MyFolder", System.Reflection.Missing.Value); myFolder.Views["By Location"].Delete(); |
Remove Standard View in Outlook 2007?
Standard views can't be deleted using the Outlook object model, as Sue
pointed out and I missed. You can hack things using hidden messages but I'd expect the standard views to be re-created if a switch like /cleanviews was used to start Outlook. I don't see any Delete method there in the Object Browser for the Views collection. A View object has a Delete method but as far as I can see the Views collection only has a Remove method. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Fidget Brain" wrote in message ... the preliminary Outlook 2007 developers documentation lists a Delete() and a Remove() method. I have tried both of these methods in an attempt to remove a standard view from the collection. I am able to remove a custom view that I have added myself using these methods. However I am unable to remove a standard view because I get a COM error. The reason I am trying to do this is because I have set up a new NavigationPane folder based on a custom MAPI Folder that I have created. When a user clicks to insert a new item or edit an item from this MAPI Folder, the form region I am exposing replaces the default Contacts form and only user defined fields are visible. Urgo when a user clicks my navigation folder, I do not want to display a list of Views to a user that are based on the standard Outlook Contacts item. This does not make sense as my resulting form will not expose these fields, so why would they want to see them listed in its View?. Instead I want a customised Views list which shows only my user defined fields. it seems to me that if Microsoft are allowing developers to create form regions which completely override and customise the original Contacts form, then it follows that I would also need this for the Views on the navigation pane as well? this is a big sticking point for me as I cant seem to get info about how to solve this. I will try your suggestion Sue. any more suggestions/help from anybody would be greatly appreciated. |
All times are GMT +1. The time now is 08:56 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-2006 OutlookBanter.com