MSDN says: queryCommandValue is a wrapper for IOleCommandTarget::QueryStatus. But I can get value by this: CComVariant var; spDoc2->queryCommandValue(L"FormatBlock",&var); And cannot get value by this: OLECMD cmds[1]; cmds[0].cmdID=IDM_BLOCKFMT; struct { OLECMDTEXT cmdTxt; wchar_t buffer[32]; }buf={{OLECMDTEXTF_STATUS,0,32}}; spCmdTgt->QueryStatus(&CGID_MSHTML,1,cmds,&buf.cmdTxt); what's wrong with my code? thx!