I've tracked down the problem. There seems to be an issue when Outlook 2003 is using Word 2003 as the email editor. I had a .rtf file open and all the command bars were getting added there.
I'd like to sort that out eventually but for now it can be alleviated by unselecting Word 2003 as the email editor under "Options".
My code below is also incorrect and needs:
myInspectors.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler (MyInspectors_NewInspector);
Brent
Brent <a[ at ]b.c> wrote in news:Xns98C4A00104CA3abc[ at ]140.99.99.130:
[Quoted Text] > > > > > 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 > > > > > > > >
|