Can't get CommandBars in 2007, works in other Outlook versions?

B

Beiley

My COM Add-in for Outlook works fine in 2000, XP, and 2003, but in
2007 I can't get the CommandBars. I get an exception when I try.
Here is my code:


Outlook::_Explorer* spExplorer = g_ppvApplication->ActiveExplorer();
if( spExplorer != NULL )
{
Office::_CommandBarsPtr spCmdBars;
try
{
spCmdBars = spExplorer->CommandBars;
}
catch(...)
{
// This gets called in Outlook 2007 only!
Why??

DebugTrace( DEBUG_TRACE_BASIC, "Failed to get CommandBars\n");
return;
}
}

This code is being called from my 'OnStartupComplete' function. Any
ideas/suggestions?

Thanks,
Mark
http://www.beiley.com
 

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