我正在通过 .net 应用程序在 Microsoft Outlook 中创建文件夹,但仅在我重新启动 Outlook 时才会显示。无需重新启动 Outlook 即可显示新文件夹。我正在使用以下代码:
Outlook.NameSpace nameSpace = OutlookApp.GetNamespace("MAPI");
Outlook.MAPIFolder folderInbox = nameSpace.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Folders inboxFolders = folderInbox.Folders;
Outlook.MAPIFolder subfolderInbox = null;
Outlook.Application oApp;
oApp = nameSpace.Application;
Outlook.Explorer exp = oApp.ActiveExplorer();
subfolderInbox = inboxFolders.Add("InboxSubfolder",
Outlook.OlDefaultFolders.olFolderInbox);
exp.CurrentFolder = subfolderInbox;