Free Support Forum - aspose.com

Saving document to docx (Office 2010)

Good Morning,


I’m currently trying to create a document which is saved in the real 2010-docx format. I’m building my document and the save it using SaveFormat.DOCX.
When opening that in Word 2010 it always says that this document is opened in Compatibility Mode. When trying to save such a document word always says do you want to check compatibility…

In the forums I’ve read the Aspose provides real Office 2010 support. What do I have to do to save my document as a 2010 docx file?

Best Regards

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You should just set OoxmlCompliance option. Please try using the following code:

Document doc = new Document("C:\\Temp\\in.docx");

OoxmlSaveOptions opt = new OoxmlSaveOptions(SaveFormat.DOCX);

opt.setCompliance(OoxmlCompliance.ISO_29500_2008_TRANSITIONAL);

doc.save("C:\\Temp\\out.docx", opt);

Best regards,

Hey Andrey,


thanks for your fast response.
I’ve tried that in my code but now the documents I generate can’t be opened by Word.

I’ve attatched a document fou you to see what the problem is.

Best Regards

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you please attach your input document here for testing? I will check it on my side and provide you more information.

Best regards,

Of couse, I attatched my input document.


Best Regards and thanks for your help!

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

Hey Andrey,

any news on this issue. We’re a paying customer and this issue has a real real high priority for us. We are currently having production problems caused by this and we need a fix as soon as possible.

Best regards,
Jan

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Unfortunately, the issue is still unresolved and currently I cannot provide you any reliable estimate regarding this issue. You will be notified as soon as it is fixed.

Best regards,

Hey Andrey,

this topic is being discussed on a very high level in my company and our customers company.
Any news on this issue?
Is there anything wrong with my template?
Any way to work around this issue?

I really need a solution as fast as possible to generate a clean working Office 2010 docx file.

Best Regards,
Jan

Hello Jan,

Thanks for your request. Unfortunately the issue is still unresolved. I added your request to my monthly report, so its priority will be increased. I will keep you informed on any developments regarding this issue.

As a temporary workaround you can try using the following code:

Document doc = new Document("C:\\Temp\\allgemein_Vorlage.docx");

// Convert DOCX to DOC to fix the problem.

ByteArrayOutputStream byteStream = new ByteArrayOutputStream();

doc.save(byteStream, SaveFormat.DOC);

InputStream inputStream = new ByteArrayInputStream(byteStream.toByteArray());

// Create com.aspose.words.Document from InputStream.

doc = new Document(inputStream);

OoxmlSaveOptions opt = new OoxmlSaveOptions(SaveFormat.DOCX);

opt.setCompliance(OoxmlCompliance.ISO_29500_2008_TRANSITIONAL);

doc.save("C:\\Temp\\out.docx", opt);

Best regards,

Hey Andrey,

first of all thanks for taking this issue serious.
I tried the code you provided and there are two things to mention.
First of all:
The file generated isn’t broken anymore!
Word still says “Compatibility mode”. So it looks like that isn’t a “real” Office 2010 file…any idea what goes wrong or why word still says “Compatibility Mode”?

Best Regards,
Jan

Hi Jan,

Thank you for additional information. I managed to reproduce this problem on my side too. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Unfortunately, currently, I cannot suggest you any way to work this problem around.

Best regards,

The issues you have found earlier (filed as WORDSNET-4637) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hello guys,

I’m now able to generate and open files which are generated using ISO_29500_2008_TRANSITIONAL but Word 2010 still says “Compatibility Mode”!

What’s going wrong there?

Best regards!
Jan Thewes

Hello

Thanks for your request. This problem is still unresolved. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed. Sorry for inconvenience.

Best regards,

Ok, I hope that this problem get’s resolved soon. Cause I’m currently not able to generate docx documents for Word 2010.
So the functionalty for which we migrated to Aspose isn’t there at the moment.
But so far I like your new release cycles.
Keep up the good work and please take a look at this issue.

Best Regards

Hello

Thanks for your request. We will be sure to inform you of any developments regarding this issue.

Best regards,

I’m sorry but I’ve to annoy you again.
Is this problem activley being worked on?
Any chance that it gets fixed with the upcoming release?
I’m getting in real trouble slowly.

Thanks for your help.
Best regards!
Jan

Hi

Thanks for your request. Unfortunately, there is still no news about this issue. I asked the responsible developer to take a look at the issue shortly. We will keep you informed and let you know once the issue is fixed.

I apologize for inconvenience.

Best regards,

Hey Alexey,

any updates on this issue? Can I expect this to be fixed on the upcoming monthly release?
I really need a fix or workaround for this one. The day our customer migrates to Office 2010 is coming closer and I’m still unable to generate the documents correctly.

Thanks for your help.
Best Regards!