IOleClientSite *pClientSite = NULL;
this->GetClientSite(&pClientSite);
CComPtr<IOleContainer> pContainer;
HRESULT hr = pClientSite->GetContainer(&pContainer);
if (hr == S_OK)
{
CComQIPtr<MSWord::_Document> spDoc(pContainer);
ATLASSERT(spDoc);
....
}
For more information about Word Document Object Model, see Word VBA Help.