Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Save as docx from Word 2007
I'm attempting to open a .doc file in a C++ Word 2007 automation
program and save it as docx, but the resulting document is always in compatibility mode. Here's the relevant code: short wdFormatXMLDocument = 12; COleVariant vXMLFormat(wdFormatXMLDocument, VT_I2); CString sName = m_pDocument-get_FullName(); CString sTempName = sName + _T("x"); CComVariant vName(sName); CComVariant vTempName(sTempName); COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); m_pDocument-SaveAs(&vTempName, &vXMLFormat, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional, &covOptional); m_pDocument-Close(&viDoNotSave, &vOriginalFormat, &vbFalse); m_pDocument = NULL; closeDoc(false); Instead of wdFormatXMLDocument I've also tried long wdFormatDocumentDefault = 16, with the same result. Can anyone tell me what I'm doing wrong? Thanks, David |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Save as docx from Word 2007
For anyone who may be reading this and having the same problem, the
solution is to call the Convert() method of the document class before calling SaveAs. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mailmerge from Access 2007 to Word 2007 .docx document | Mailmerge | |||
Word 2003 for doc files and 2007 for docx? | Microsoft Word Help | |||
Cannot save a Word 2003 Doc to Word 2007 docx full mode | Microsoft Word Help | |||
2007 to 2003 converter (docx-doc) "CONVERTER FAILED TO SAVE THE FI | Microsoft Word Help | |||
2007 Default Doc save is DOCX how to make DOC? | New Users |