1

I am very new in outlook 2007 add in project. I would like to know the event name when I select the start time in calendar of outlook (as below code that I tried for event). Thanks in advance.

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
}

}

1 Answers1

0

I am not sure what this has to do with ASP.Net... Your C# or VB.Net addin can use the Explorer.SelectionChange event. Explorer object can be retrieved from Application.ActiveEXplorer

When the event fires, read the Explorer.CurrentView property, check if it is an instance of the the CalendarView object and use the CalendarView.SelectedStartTime and SelectedEndTime properties.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78