Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Saving Word document

$
0
0

I would like to save a Word document according to the Word installed version;

In case it is Word 2003 (appropriate version number is 11), with DOC extension.
In case the Word version is higer than 2003, with DOCX extension.

The difference is reflected in the second argument sent to the SaveAS method:

object fileFormat =GraphDocsSettings.Default.WordInstalledVersion>11.0?WdSaveFormat.wdFormatXMLDocument :WdSaveFormat.wdFormatDocument;

wordDoc.SaveAs(ref outputFile, fileFormat,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing);

However, When using Interop.Word 11.0 I get the following error:

Microsoft.Office.Interop.Word.WDSaveFormat does not contain a definition for wdFormatXMLDocument.

Any ideas?


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>