如今直上银河去,同到牵牛织女家.
需要导入Mso9.dll
void CDefineOfficeCtrl::DefineShowHideCommandBar(short iCommandIndex, BOOL bShowHide)
{
MsWord9__Document pDoc;
pDoc.AttachDispatch(pDefineOfficeFrame->pDefineOfficeView->lpDispatch,FALSE);
Mso9__CommandBars pCommandBars;
Mso9_CommandBar pCommandBar;
pCommandBars=pDoc.GetCommandBars();
pCommandBar=pCommandBars.GetItem(COleVariant((short)iCommandIndex));
pCommandBar.SetVisible(bShowHide);
//
pCommandBar.ReleaseDispatch();
pCommandBars.ReleaseDispatch();
pDoc.DetachDispatch();
pDoc.ReleaseDispatch();
}