Can't open version 2010 .docx in the program

Z

zhenjieyu

Hi:
I'm C++ programmer using Words library for MFC , which allow me to display words document in windows application screen. we used "msword.h" and "msword.cpp"
provided by Microsoft before, every thing look fine until new version 2010 was been introduced.
now when we using the function for get document in version 2010, it can't work any more. and idea what should I do to make the program can handle new version word document?

thanks.
peter


COleVariant vOpt(DISP_E_PARAMNOTFOUND, VT_ERROR);
_Application oWordApp;
oWordApp.CreateDispatch(_T("Word.Application"));
if(oWordApp == NULL)
return;

Documents oWordDocs = oWordApp.GetDocuments();
//for Word 2002
_Document oDoc = oWordDocs.Open(COleVariant(sFile), vOpt, vOpt, vOpt, vOpt, vOpt,vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top