I'm adding calendar folders as below (C#):
folder = parentFolder.Folders.Add(name, Outlook.OlDefaultFolders.olFolderCalendar);
Sometimes (with no visible pattern, it's quite random), the folder appears in Outlook calendar list, sometimes it doesn't. I'd say it's fifty/fifty. When I create several folders, it can fail for the 1st one in a row, or 3rd, or 2nd. Again, no pattern.
If I restart Outlook, the missing folder finally appear in calendar list. Also, these missing folders cannot be added to navigation groups programmatically (COMException with "try again later" text occurs).
When I check and compare properties of newly created Outlook.Folder in debug windows, I see they are identical for those which are ok and which are not. In particular, DefaultItemType and DefaultMessageClass are the same as for full-on calendar folders.
At the same time, these folder do appear in Outlook folder list (which you access by clicking "..." button and then "Folders" in the context menu). They can be selected there, their contents viewed, etc. But their icon is shown as for normal folder, not calendar folder. Also, on right-click menu, I see actions specific for normal folders, like "IMAP Folders". Upon Outlook restart, their icon changes to calendar's icon.
C1 and two other folders were created fine right from the start, several others (like t2) - have this issue.
All 8 folders are created with the same code within the same loop under the same conditions at the same time.
So, looks like sometimes Outlook creates a folder but without assigning its status as Calendar (more exactly, this assignment is delayed until Outlook restart). And it's absolutely intermittent.
Can this be worked around somehow? To "force" Outlook to assign the calendar status for a folder immediately?
The issue seems to be specific for Outlook 2016, the same never occurred for me with 2010 version. Honestly saying, it looks like a bug in Outlook but I need to work it around anyway and was hoping if someone may come with any suggestions.
EDIT: The issue reproduces even if I create a folder with MFCMAPI tool, no VSTO addin or Outlook COM API involved at all. Certainly a bug in Outlook 2016.
Even if create a calendar directly in Outlook UI with New Calendar command, it happens sometimes.