Problem Accessing command bars on Outlook 2003

  • Thread starter Thread starter Douglas Abbink
  • Start date Start date
D

Douglas Abbink

Howdy,

I have a C# Addin. On 80% of computers, it works great. On the other 20%,
the Addin cannot get a hold of the command bars so I can add my button. I
have tried various ways to get a hold of the CommandBars and none have been
successful on a small set of machines. On example of how I have tried to
get a hold of the commandbars is below.

Is there possibly some setting in outlook or WinXP that might be preventing
me from getting the commandbars on these select machines?

code:

oActiveExplorer = applicationObject.GetType().InvokeMember("ActiveExplorer",
BindingFlags.GetProperty, null, applicationObject, null);

oCommandBars =
(Microsoft.Office.Core.CommandBars)oActiveExplorer.GetType().InvokeMember("CommandBars",
BindingFlags.GetProperty, null, oActiveExplorer, null);
 
We found the problem. It looks like the machines that this has a problem
with do not have the PIAs installed. The few laptops that we saw issues on
had Office 2003 Small business, when most of the company uses Office 2003
Pro.

The big headache was that we couldn't get an error code out of the
OnStartupComplete() method where the issue was occuring. It looks like when
the CommandBars code was in the method, the function acted like it wasn't
even getting called (stupid C#).

Installed the PIAs and everything is great.

Douglas
 
Back
Top