This may be more complicated than indicated by the title as the collection I'm referring to is a CommandBars collection found in a Microsoft.Offic e.Interop.Outlo ok.Inspector from VSTO 2005 SE.
In Outlook VBA I might typically have an Inspector object (equivalent to Microsoft.Offic e.Interop.Outlo ok.Inspector in C#) named VBAInspector and within that Inspector I could refer to :
This would return the CommandBar object whose name was "View" (Essentially the View menu from the Inspector. An Inspector is a window opened by Outlook to show any item such as an email, contact, task, etc).
In my C# code I have (I've tried to limit the code to relevant lines but can post more if that would be helpful) :
This produces the following error message for line #10 :
If I've missed anything out then just let me know and I'll be happy to provide any further information.
In Outlook VBA I might typically have an Inspector object (equivalent to Microsoft.Offic e.Interop.Outlo ok.Inspector in C#) named VBAInspector and within that Inspector I could refer to :
Code:
VBAInspector.CommandBars("View")
In my C# code I have (I've tried to limit the code to relevant lines but can post more if that would be helpful) :
Code:
using Outlook = Microsoft.Office.Interop.Outlook;
...
private Outlook.Inspector olInspector;
...
private void olInspector_Activate()
{
Office.CommandBar cbView;
cbView = olInspector.CommandBars("View");
}
Code:
'Microsoft.Office.Interop.Outlook._Inspector.CommandBars' is a 'property' but is used like a 'method'
Comment