Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Outlook加载项C#中捕获会议请求的接受/拒绝/建议新时间事件_C#_Xml_Outlook_Add In_Ribbon - Fatal编程技术网

在Outlook加载项C#中捕获会议请求的接受/拒绝/建议新时间事件

在Outlook加载项C#中捕获会议请求的接受/拒绝/建议新时间事件,c#,xml,outlook,add-in,ribbon,C#,Xml,Outlook,Add In,Ribbon,我一直在使用Outlook加载项,我需要能够捕获用户收到会议请求时显示的三个按钮(接受、拒绝和建议新时间)的单击事件 我在网上浏览了一下,我认为这些都可以用.xml处理,但由于某些原因,我似乎无法启动我的事件 下面的链接似乎为我的问题提供了某种答案,这就是我目前所遵循的策略 我已将.xml功能区项添加到项目中: <?xml version="1.0" encoding="UTF-8"?> <customUI xmlns="http://schemas.microsoft.co

我一直在使用Outlook加载项,我需要能够捕获用户收到会议请求时显示的三个按钮(接受、拒绝和建议新时间)的单击事件

我在网上浏览了一下,我认为这些都可以用.xml处理,但由于某些原因,我似乎无法启动我的事件

下面的链接似乎为我的问题提供了某种答案,这就是我目前所遵循的策略

我已将.xml功能区项添加到项目中:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <commands>
    <command idMso="DeclineInvitationNoResponse" onAction="Decline"/>
    <command idMso="AcceptInvitationNoResponse" onAction="Accept"/>
  </commands>
</customUI>
但是,我还没有设法让Accept/Reject例程中的代码运行

任何帮助都将不胜感激

谢谢


Benjamin Biggs

如果您想让我们在您的代码中找到问题,您应该发布代码。否则我们不能帮你让它工作。抱歉。我添加了一些代码块。如果你还需要我解释什么,我可以。我不太理解url(?)作为.xml文件的一部分。我正在使用Visual Studio 2010并为Outlook 2007编写外接程序。好的,这不是我的活动领域,但感谢您提供代码。我希望其他专家能帮助你!你有没有想过?
 namespace EquipmentScheduler
{
    [ComVisible(true)]
    public class AlterMeetingResponse : Office.IRibbonExtensibility
    {
        private Office.IRibbonUI ribbon;

        public AlterMeetingResponse()
        {
        }

        #region IRibbonExtensibility Members

        public string GetCustomUI(string ribbonID)
        {
            return GetResourceText("EquipmentScheduler.AlterMeetingResponse.xml");
        }

        #endregion

        #region Ribbon Callbacks
        //Create callback methods here. For more information about adding callback methods, select the Ribbon XML item in Solution Explorer and then press F1

        public void Decline(Office.IRibbonControl Control, bool Cancel)
        {
            Debug.Print("Decline button hit");
        }
        public void Accept(Office.IRibbonControl Control, bool Cancel)
        {
            Debug.Print("Accept button hit");

            }
        }
        public void Ribbon_Load(Office.IRibbonUI ribbonUI)
        {
            this.ribbon = ribbonUI;
        }

        #endregion

        #region Helpers

        private static string GetResourceText(string resourceName)
        {
            Assembly asm = Assembly.GetExecutingAssembly();
            string[] resourceNames = asm.GetManifestResourceNames();
            for (int i = 0; i < resourceNames.Length; ++i)
            {
                if (string.Compare(resourceName, resourceNames[i], StringComparison.OrdinalIgnoreCase) == 0)
                {
                    using (StreamReader resourceReader = new StreamReader(asm.GetManifestResourceStream(resourceNames[i])))
                    {
                        if (resourceReader != null)
                        {
                            return resourceReader.ReadToEnd();
                        }
                    }
                }
            }
            return null;
        }

        #endregion
    }
}
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
        {
            return new AlterMeetingResponse();
        }