Code:
#include "msword8.h"
....
....
_Application oWordApp;
_Document doc;
Selection oSel;
COleVariant covTrue((short)TRUE), covFalse((short)FALSE), covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR),varpasw;
if (!oWordApp.CreateDispatch("Word.Application"))
{
AfxMessageBox("Couldn't get Word object.");
return;
}
Documents docs(oWordApp.GetDocuments());
doc.AttachDispatch(docs.Add(covOptional,covOptional));
oSel = oWordApp.GetSelection();
.....
....
so... search for "oWordApp GetDocuments" on yandex, altavista or other search engine