Free Support Forum - aspose.com

Saving as Word 2013

Dear Sir or Madam,

How can I save a word document in Word 2013/2016 format? Currently when we save a file using Aspose.Words it saves in Word 2007:
<AppVersion>12.0000</AppVersion>

Regards,
Alex

@AlexanderNovickov

The BuiltInDocumentProperties.Version is related to AppVersion property in app.xml and MS Word does not allow to change it. This property represents the version number of the application that created the document. BuiltInDocumentProperties.Version has very little relation to document format.

In your case, we suggest you please use the following code example to get the desired output.

Document doc = new Document(MyDir + "input.docx");

doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2013);
OoxmlSaveOptions options = new OoxmlSaveOptions();
options.Compliance = OoxmlCompliance.Iso29500_2008_Strict;
doc.Save(MyDir + "output.docx", options);

Hi Tahir,

Thank you for your quick reply. I tried the code you provided, but the document still has AppVersion 12, see the file attached.
outputDoc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2013);
OoxmlSaveOptions options = new OoxmlSaveOptions();
options.Compliance = OoxmlCompliance.Iso29500_2008_Strict;
outputDoc.Save(ms, options);
Downloads.zip (12.2 KB)

Regards,
Alex

@AlexanderNovickov

As shared in my previous post, the BuiltInDocumentProperties.Version is related to AppVersion property in app.xml and MS Word does not allow to change it.

This property represents the version number of the application that created the document. BuiltInDocumentProperties.Version has very little relation to document format.

The shared code example generates the correct OOXML document.

Hi Tahir,

Yes I understood it. But I originally create the original document from scratch using Aspose.Words. Isn’t it Aspose.Words who fills this property in while creating a new file. Just curious.

Regards,
Alex

@AlexanderNovickov

We use MS Word 2007 template when a document is created from scratch using Aspose.Words. This is the reason you are getting value of AppVersion as 12.0.