简体   繁体   中英

Adding panel to Appointment/calendar item window in outlook

OBJECTIVE: C# .Net VSTO2010 i need to add a panel to appointment/calendar item window in outlook. AppointmentItem window means window which opens when we click an appointment or create new appointment in outlook. I need to display to some details(appoitnmentitem related) in appointmentItem Window (i prefer to use panel). Actually i am displaying some details (addin related details) in separate tab as form in appointment item window, i want to display those details in single window(appointmentitem window) of appointmentItem

Inspector :Represents the window in which an Outlook item is displayed. but in Inspector there is no support for adding panel

I am able to add panel or custom task pane in outlook main window .but i am not able to do in appointmentitem window.

I am using .Net 4 framework ,visual studio 2010. This has to be done in a outlook Addin, addin is target for MS office outlook 2003,2007,2010(atleast it should support 2007and 2010).

adding panel to outlook main window can be done using window handle and window class , then using function in User32.dll. but same technique i am not able to use on appointmentitem window.( i am not able to get handle of appointment item window)

adding custom task pane to outlook main window can be done using some code but i didnt find functionality to do it on appointment item window.

looking for good help or suggestions

You Can Add the side panel through the Custom Task panes and New Inspector Event Handler.

Step 1:

   private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        inspectors = this.Application.Inspectors;
        inspectors.NewInspector +=
        new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(NewInspectorHandler);
    }

Step 2:

        public void Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
    {
        Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane;

        if(Inspector.CurrentItem is  Microsoft.Office.Interop.Outlook.AppointmentItem ) {

            UserControl uc1 = MyUserControl();
            myCustomTaskPane = getAddIn().CustomTaskPanes.Add(uc1, "MyPanel",Inspector);
            myCustomTaskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
            myCustomTaskPane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
            myCustomTaskPane.Visible = true;

        }

        //Additionally You can add a property change listener to the current Item here
    }

This will show the Custom side panel in Appointment Item

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM