小编Ram*_*mki的帖子

Outlook 2016 VSTO 文件夹添加事件仅触发一次

正在创建一个 Outlook 插件来跟踪邮箱中的邮件处理。我正在包装文件夹和项目(向其中添加一些事件)并将它们存储在本地列表中,以避免 GC 在首次执行后清除所有事件。但是,文件夹添加事件仍然只触发一次。不确定是什么问题。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using OutlookNS = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;
using System.Net;
using System.Windows.Forms;


namespace OutlookAuditor
{
    public partial class ThisAddIn
    {
        #region private variables

        OutlookNS._NameSpace outNS;
        OutlookNS.Explorer explorer;
        string profileName = string.Empty;
        List<SuperMailFolder> wrappedFolders = new List<SuperMailFolder>();
        Logger logger = new Logger();
        SuperMailFolder folderToWrap;
        #endregion

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            try
            {
                OutlookNS.Application application = this.Application;

                //Get the MAPI namespace
                outNS = application.GetNamespace("MAPI");
                //Get …
Run Code Online (Sandbox Code Playgroud)

c# vsto outlook-addin

3
推荐指数
1
解决办法
782
查看次数

标签 统计

c# ×1

outlook-addin ×1

vsto ×1