如何聚焦 Outlook 2010 自定义功能区选项卡
我有一个自定义 Outlook 2010 功能区选项卡,其类型为 Microsoft.Outlook.Appointment。
在该选项卡中,我有几个按钮可以更改当前约会项目,并调用其 Save
方法。但是,该方法始终将焦点更改为检查器的第一个选项卡。我希望焦点保留在我的自定义选项卡上。
这是我当前的代码:
private void ButtonSaveAppointment(object sender, RibbonControlEventArgs e)
{
Outlook.Inspector inspector = (Outlook.Inspector)this.Context;
Outlook.AppointmentItem appointment = (Outlook.AppointmentItem)inspector.CurrentItem;
appointment.Save();
this.RibbonUI.ActivateTab(this.Tabs[0].ControlId.ToString());
}
这对我不起作用。谁能告诉我我做错了什么? 谢谢。
I have a custom Outlook 2010 Ribbon tab that has the type Microsoft.Outlook.Appointment.
In that tab, I have several buttons that change the current appointment item, and call its Save
method. However, that method always changes the focus to the first tab of the inspector. I want the focus to remain on my custom tab.
Here is my current code:
private void ButtonSaveAppointment(object sender, RibbonControlEventArgs e)
{
Outlook.Inspector inspector = (Outlook.Inspector)this.Context;
Outlook.AppointmentItem appointment = (Outlook.AppointmentItem)inspector.CurrentItem;
appointment.Save();
this.RibbonUI.ActivateTab(this.Tabs[0].ControlId.ToString());
}
This does not work for me. Can anyone tell me what am i doing wrong?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我在加载事件中使用的内容:
这与我在代码中看到的内容相对应:
该代码在加载事件中很好地触发,但我测试了它,当您从函数调用它时它不起作用。请尝试将其移至加载事件,您将看到代码有效。我的猜测是,它不能从方法正常工作,而只是形成加载事件。
祝你好运
This is what i use in my load event:
And that would correspond to what i see in your code:
That code fires well in the load event, but i tested it and it does not work when you are calling it from a function. Please try and move it to the load event and you will see that the code works. My guess is that it does not work properly from a method but just form the load event.
Good luck