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();