【发布时间】:2023-01-31 04:36:27
【问题描述】:
我有一个 outlook 插件,可以在加载项启动完成时向 outlook 添加自定义类别。
public void CreateCategories()
{
RDOCategories categories = null;
RDOCategory category = null;
try
{
var customCategoryList = FileManager.GetCustomCategoryList();
categories = rSession.Categories;
// add category
foreach (var customCategory in customCategoryList)
{
try
{
category = categories.Add(customCategory.Name
, PaintHelper.GetHexCodeByColorName(customCategory.Color));
}
catch (Exception ex)
{
}
finally
{
if (category != null)
{
Marshal.ReleaseComObject(category);
}
}
}
}
catch (Exception ex)
{
}
finally
{
if (categories != null)
{
Marshal.ReleaseComObject(categories);
}
}
}
当我从 outlook 中删除所有类别并尝试运行插件时,它仍然显示计数rSession.类别作为 6,它添加了所有默认的 6 个类别以及自定义类别。
我们可以在删除所有 outlook 类别时省略添加默认类别吗?
【问题讨论】:
-
为什么需要使用 Redemption 来处理 Outlook 中的类别?
标签: c# outlook vsto outlook-addin outlook-redemption