记void __fastcall TForm1::Button2Click(TObject *Sender){ OleContainer1->DestroyObject(); OleContainer1->CreateObject("Word.Document", false); OleContainer1->DoVerb(ovInPlaceActivate); Variant vObj = OleContainer1->OleObject; int nCmdBarCount = vObj.OlePropertyGet("CommandBars").OlePropertyGet("Count"); for (int i =0; i < nCmdBarCount; i++) { vObj.OlePropertyGet("CommandBars", i + 1).OlePropertySet("Enabled", false); }}