3,245
社区成员
发帖
与我相关
我的任务
分享
IDispatch * lDisp ;
if(!lDisp)
{
get_ActiveDocument(&lDisp);
if(!lDisp)
{
return S_OK;
}
}
COleVariant vTrue((short)TRUE), vFalse((short)FALSE),vOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
CComQIPtr<MSWord::_Document> doc(lDisp);
if(!doc)
return S_OK;
CComPtr<MSWord::_Application> app(doc->GetApplication());
CComPtr<MSWord::Selection> spSelection = NULL;
hr = app->get_Selection(&spSelection);