ccomqiptr < office::_commandbarbutton> spcmdbutton2(spnewbar2);
atlassert(spcmdbutton);
m_spbutton = spcmdbutton;
atlassert(spcmdbutton2);
// to set a bitmap to a button, load a 32x32 bitmap
// and copy it to clipboard. call commandbarbutton's pasteface()
// to copy the bitmap to the button face. to use
// word's set of predefined bitmap, set button's faceid to //the
// button whose bitmap you want to use
hbitmap hbmp =(hbitmap)::loadimage(_module.getresourceinstance(),
makeintresource(idb_bitmap1),image_bitmap,0,0,lr_loadmap3dcolors);
// put bitmap into clipboard
::openclipboard(null);
::emptyclipboard();
::setclipboarddata(cf_bitmap, (handle)hbmp);
::closeclipboard();
::deleteobject(hbmp);
// set style before setting bitmap
spcmdbutton->putstyle(office::msobuttoniconandcaption);