if(failed(hr))
return hr;
atlassert(spcmdbars);
// now we add a new toolband to word
// to which we'll add 2 buttons
ccomvariant vname("wordaddin");
ccomptr <office::commandbar> spnewcmdbar;
// position it below all toolbands
//msobarposition::msobartop = 1
ccomvariant vpos(1);
ccomvariant vtemp(variant_true); // menu is temporary
ccomvariant vempty(disp_e_paramnotfound, vt_error);
//add a new toolband through add method
// vmenutemp holds an unspecified parameter
//spnewcmdbar points to the newly created toolband
spnewcmdbar = spcmdbars->add(vname, vpos, vempty, vtemp);
//now get the toolband's commandbarcontrols
ccomptr < office::commandbarcontrols> spbarcontrols;
spbarcontrols = spnewcmdbar->getcontrols();