commandBars["Menu Bar"] gives system._comobject when retrieved through reflection

M

mrudulan

Hi,
In my outlook plugin to avoid the reference to office dll I am
accessing the properties using reflection.
Here's my code.

Explorer explorer = _applicationObject.ActiveExplorer();
PropertyInfo pi = explorer.GetType().GetProperty("CommandBars");
object objCommandBars = pi.GetValue(explorer,new object[0]);
object objMenu =
objCommandBars.GetType().InvokeMember("Item",BindingFlags.GetProperty,null,objCommandBars,new
object[]{"Menu Bar"});

Here, the last statement returns System._Comobject into objMenu.
Can anyone tell me the reason for it and how to solve it.
Thanks,
Praisy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top