H
Hans Schmidt
Hello,
i'm trying to recognize in my COM-Addin if a mail or appointment
object is selected. In both cases i will add a commandbar. Therefore i
implemented the OnNewInspector event and the OnSelectionChange event.
public partial class ThisAddIn
{
Outlook.Application applicationObject;
private Outlook.Inspectors _inspectors;
Outlook.Explorer explorer;
Outlook.Selection selection;
private void ThisAddIn_Startup(object sender, System.EventArgs
e)
{
_inspectors = Application.Inspectors;
_inspectors.NewInspector += new
Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler
(ThisApplication_NewWindowOpen);
explorer = Application.ActiveExplorer();
explorer.SelectionChange += new
Outlook.ExplorerEvents_10_SelectionChangeEventHandler(
Explorer_SelectionChange);
}
void ThisApplication_NewWindowOpen
(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
}
void Explorer_SelectionChange()
{
}
private void ThisAddIn_Shutdown(object sender,
System.EventArgs e)
{
}
#region Von VSTO generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor
geändert werden.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler
(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler
(ThisAddIn_Shutdown);
}
#endregion
}
I tried different things with Outlook.Selection selection; but never
came to a solution.
In several vb examples the developers used selection.item but i can't
find that in C#
has got anybody a solution?
Thanks and greets Hans
i'm trying to recognize in my COM-Addin if a mail or appointment
object is selected. In both cases i will add a commandbar. Therefore i
implemented the OnNewInspector event and the OnSelectionChange event.
public partial class ThisAddIn
{
Outlook.Application applicationObject;
private Outlook.Inspectors _inspectors;
Outlook.Explorer explorer;
Outlook.Selection selection;
private void ThisAddIn_Startup(object sender, System.EventArgs
e)
{
_inspectors = Application.Inspectors;
_inspectors.NewInspector += new
Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler
(ThisApplication_NewWindowOpen);
explorer = Application.ActiveExplorer();
explorer.SelectionChange += new
Outlook.ExplorerEvents_10_SelectionChangeEventHandler(
Explorer_SelectionChange);
}
void ThisApplication_NewWindowOpen
(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
}
void Explorer_SelectionChange()
{
}
private void ThisAddIn_Shutdown(object sender,
System.EventArgs e)
{
}
#region Von VSTO generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor
geändert werden.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler
(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler
(ThisAddIn_Shutdown);
}
#endregion
}
I tried different things with Outlook.Selection selection; but never
came to a solution.
In several vb examples the developers used selection.item but i can't
find that in C#
has got anybody a solution?
Thanks and greets Hans