N
news.microsoft.com
Hi
I started looking at writing addins for Outlook and found what looks like a
very nice intro text on the subject
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/ol03csharp.asp
I copied the source into Visual studio, compiled and installed. But nothing
happend. Then I added some MessageBoxes to tell me more.
Tried:
MessageBox.Show(commandBars.GetType().ToString());
MessageBox.Show(commandBars.ActiveMenuBar.Name);
btnGetEMailStats = (CommandBarButton)
commandBars["Standard"].Controls.Add(1,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value);
The secound MessageBox fails as it seams all "uses of" commandBars gives me
a NullReferenceException - well note CommandBars.getType(), but
commandBars.GetEnumerator or commandBars["Standard"] and so on.
What could be wrong? I have seen this example all over - getting the
commandBars and looking for and index "Standard" and so on. The example was
taken as is - I did not change anything at first and only added
MessageBox.Show commands...
Best Regards
Jan Agermose
I started looking at writing addins for Outlook and found what looks like a
very nice intro text on the subject
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/ol03csharp.asp
I copied the source into Visual studio, compiled and installed. But nothing
happend. Then I added some MessageBoxes to tell me more.
Tried:
MessageBox.Show(commandBars.GetType().ToString());
MessageBox.Show(commandBars.ActiveMenuBar.Name);
btnGetEMailStats = (CommandBarButton)
commandBars["Standard"].Controls.Add(1,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value);
The secound MessageBox fails as it seams all "uses of" commandBars gives me
a NullReferenceException - well note CommandBars.getType(), but
commandBars.GetEnumerator or commandBars["Standard"] and so on.
What could be wrong? I have seen this example all over - getting the
commandBars and looking for and index "Standard" and so on. The example was
taken as is - I did not change anything at first and only added
MessageBox.Show commands...
Best Regards
Jan Agermose