B
Brent
Hi everyone,
I'm trying to add a command bar to the email message window that opens
when you click on "New". I'm trying to do this in C# and am somewhat new
to the Outlook object model. Upon looking at the msdn documentation I
tried using the NewInspector event as follows:
private Outlook.Inspectors myInspectors;
public void Initialize_handler()
{
myInspectors = this.Application.Inspectors;
}
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Initialize_handler();
}
private void MyInspectors_NewInspector(Outlook.Inspector Inspector)
{
myBar = Inspector.Commandbars.Add(commandBarName,
Office.MsoBarPosition.msoBarTop, false, true);
}
I've probably not interpreted the VBA documentation correctly. The
object model reference has the following:
Dim myOlApp As New Outlook.Application
Public WithEvents myOlInspectors As Outlook.Inspectors
Public Sub Initialize_handler()
Set myOlInspectors = myOlApp.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As
outlook.Inspector)
Inspector.CommandBars.Item("Standard").Visible = True
Inspector.CommandBars.Item("Formatting").Visible = True
End Sub
Was I following the right approach? Thanks for any advice!
Brent
I'm trying to add a command bar to the email message window that opens
when you click on "New". I'm trying to do this in C# and am somewhat new
to the Outlook object model. Upon looking at the msdn documentation I
tried using the NewInspector event as follows:
private Outlook.Inspectors myInspectors;
public void Initialize_handler()
{
myInspectors = this.Application.Inspectors;
}
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Initialize_handler();
}
private void MyInspectors_NewInspector(Outlook.Inspector Inspector)
{
myBar = Inspector.Commandbars.Add(commandBarName,
Office.MsoBarPosition.msoBarTop, false, true);
}
I've probably not interpreted the VBA documentation correctly. The
object model reference has the following:
Dim myOlApp As New Outlook.Application
Public WithEvents myOlInspectors As Outlook.Inspectors
Public Sub Initialize_handler()
Set myOlInspectors = myOlApp.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As
outlook.Inspector)
Inspector.CommandBars.Item("Standard").Visible = True
Inspector.CommandBars.Item("Formatting").Visible = True
End Sub
Was I following the right approach? Thanks for any advice!
Brent