Yes, I'm create my own toolbar
I want draw attention on fact that I'm have problems with "OnClick" event
from my buttons only when some of my buttons are hidden in the pop-up menu
which become visible when user click on the arrow button in right part of
my toolbar and after that user click on my button...
I have problems only on Outlook 2000 without servise packs, and it drop
down sometimes with access violation when I'm click on the arrow button in
right part of my toolbar, may be this is well-known "bug" of Outlook 2000
without sp's?
On Outlook 2003 or Outlook 2002 I have no problems now with my buttons...
The sample code of creating my own toolbar is:
//*****************
//....
CComPtr < Outlook::_Explorer> spExplorer;
hRes = pExchExt->m_OLAppPtr->ActiveExplorer(&spExplorer);
if (!spExplorer)
hRes = E_FAIL;
if ( m_bIsOutlook2K )
hRes = pExchExt->ExplEvents:
ispEventAdvise((IDispatch*)spExplorer);
if (!m_pCmdBars)
hRes = spExplorer->get_CommandBars(&m_pCmdBars);
if ( m_bIsOutlook2K )
hRes = pExchExt->CommandBarsEvents:
ispEventAdvise((IDispatch*)
m_pCmdBars);
CComVariant vName(strToolbarName);
Office::MsoBarPosition BarPosition;
bool bToolbarVisible;
//this function returns saved toolbar position
GetToolbarState(bToolbarVisible, BarPosition);
if (!m_cbOfflineToolbar)
hRes = spCmdBars->Add(vName, CComVariant(BarPosition), vtMissing,
CComVariant(TRUE), &m_cbOfflineToolbar);
CComPtr <Office::CommandBarControls> pBarControls = NULL;
hRes = m_cbOfflineToolbar->get_Controls(&pBarControls);
VARIANT_BOOL bLargeButtons;
hRes = spCmdBars->get_LargeButtons(&bLargeButtons);
//after that I'm create my buttons, sample code of it above in previous
//post