我在outlook 2007中添加项目非常新。 当我在outlook的日历中选择开始时间时,我想知道事件名称(如下面我为事件尝试的代码)。提前谢谢。
namespace OutlookAddIn1
{
public partial class ThisAddIn
{
private Outlook.Explorer currentExplorer = null;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
currentExplorer = this.Application.ActiveExplorer();
currentExplorer.SelectionChange += new Outlook.ExplorerEvents_10_SelectionChangeEventHandler(CurrentExplorer_Event);
}
private void CurrentExplorer_Event()
{
Outlook.MAPIFolder selectedFolder = this.Application.ActiveExplorer().CurrentFolder;
String expMessage = "Your current folder is " + selectedFolder.Name + ".\n";
String itemMessage = "Item is unknown.";
try
{
expMessage = expMessage + itemMessage;
}
catch (Exception ex)
{
expMessage = ex.Message;
}
// MessageBox.Show(expMessage);
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
答案 0 :(得分:0)
我不确定这与ASP.Net有什么关系......你的C#或VB.Net插件可以使用Explorer.SelectionChange事件。可以从Application.ActiveEXplorer
中检索Explorer对象当事件触发时,读取Explorer.CurrentView属性,检查它是否是CalendarView对象的实例,并使用CalendarView.SelectedStartTime和SelectedEndTime属性。