Issue customizing existing popup menu bar in Word

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
 

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