You know, it's actually quite strange. An exception is thrown when using
the
enum value, but the folder is actually still created. Didn't notice this
at
first until I trapped the exception and bypassed it by mistake once, and
there was the folder. No exception is thrown when using a numeric value.
Here is the exception thrown when using the enum: (I see something
regarding
permissions)
{System.__ComObject}
[System.__ComObject]: {System.__ComObject}
Application: {Outlook.ApplicationClass}
Class: olFolder
DefaultItemType: olMailItem
DefaultMessageClass: "IPM.Note"
Description: null
EntryID: (too long, i removed it from this text)
Folders: {Outlook.FoldersClass}
Items: {Outlook.ItemsClass}
Name: "Test Folder"
Parent: {System.__ComObject}
Session: {Outlook.NameSpaceClass}
StoreID: (too long, i removed it from this text)
UnReadItemCount: 0
UserPermissions: 'olNs.Folders.Item(1).Folders.Add("Test Folder",
Outlook.OlDefaultFolders.olFolderInbox).UserPermissions' threw an
exception
of type 'System.Runtime.InteropServices.COMException'
WebViewAllowNavigation: true
WebViewOn: false
WebViewURL: null
Dmitry Streblechenko said:
No, the icon displayed by Outlook depends on whether the folder is one of
the default folders in the store or on the value of the
PR_CONTAINER_CLASS
property.
Why can't you use one of the OlDefaultFolders enums? Do you get an error?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool