V
victargo
The article at:
http://support.microsoft.com/?scid=kb;en-us;312626&spid=2488&sid=228
is a good description on how to add a new Command Bar to Word. The
problem I have run into is when adding a button to an existing popup
menu. If oCommandBar in the code below is the popup menu that shows
when right clicking on a text in Word, the new button shows OK but its
event
handler m_pEightBallButton is never call.
....
// Add a button to the command bar.
oControls = oCommandBar.get_Controls();
// 1 = Office.MsoControlType.msoControlButton
oButton =
oControls.Add(COleVariant((short)1),covOptional,covOptional,covOptional,covOptional);
// Set the caption and face ID.
oButton.put_Caption("New game");
oButton.put_FaceId(1845);
SetupConnection(oButton.m_lpDispatch,&m_EventInfo[iConn],(IUnknown
*)m_pEightBallButton,DIID__CommandBarButtonEvents);
....
What could be the problem?
Thanks for reply
Peter
Reply
http://support.microsoft.com/?scid=kb;en-us;312626&spid=2488&sid=228
is a good description on how to add a new Command Bar to Word. The
problem I have run into is when adding a button to an existing popup
menu. If oCommandBar in the code below is the popup menu that shows
when right clicking on a text in Word, the new button shows OK but its
event
handler m_pEightBallButton is never call.
....
// Add a button to the command bar.
oControls = oCommandBar.get_Controls();
// 1 = Office.MsoControlType.msoControlButton
oButton =
oControls.Add(COleVariant((short)1),covOptional,covOptional,covOptional,covOptional);
// Set the caption and face ID.
oButton.put_Caption("New game");
oButton.put_FaceId(1845);
SetupConnection(oButton.m_lpDispatch,&m_EventInfo[iConn],(IUnknown
*)m_pEightBallButton,DIID__CommandBarButtonEvents);
....
What could be the problem?
Thanks for reply
Peter
Reply