Free Support Forum - aspose.com

Convert Strict XML word documents

Hi
The file detection API fails to trap Strict Word XML files as a known type do yuo have a slution or is this a defect to be fixed in a future release?

Regards Mike

@mikesoffice,

Thanks for your inquiry. Please ZIP and attach your input Word document here for testing. Pleas also share to which file format you are converting strict XML Word document. We will investigate the issue on our side and provide you more information.

Hi
File attached
Regards,Mike

The quick brown fox jumps over the lazy dogXML.zip (8.7 KB)

@mikesoffice,

Thanks for sharing the document. We have imported the shared document into Aspose.Words’ DOM and save it to DOCX file format. We have not found any issue. Could you please share some more detail about your issue that you are facing? We will investigate the issue on our side and provide you more information.

Hi
I’m trying to detect and convert a Word strict XML doc to DOCX.
This fails to detect the correct file format thereby failing to convert.The quick brown fox jumps over the lazy dogXML.zip (8.7 KB)

the CheckWordFormat.zip (3.0 KB)

Regards,Mike

@mikesoffice,

Thanks for sharing the detail. We have tested the scenario using latest version of Aspose.Words for .NET 18.3 and have not found the shared issue. Please use Aspose.Words for .NET 18.3.

You can try following simplified code example to test your issue.

var fileFormat = FileFormatUtil.DetectFileFormat(MyDir + "The quick brown fox jumps over the lazy dogXML.docx");
Console.WriteLine("The document format is: " + FileFormatUtil.LoadFormatToExtension(fileFormat.LoadFormat));

Document doc = new Document(MyDir + "The quick brown fox jumps over the lazy dogXML.docx");
doc.Save(MyDir + "output.docx");

Hi,

what Office version does doc.Save(outMs, SaveFormat.Docx); // Strict format version???
convert to ???

Reagrds, Mike

@mikesoffice,

Thanks for your inquiry. The ISO/IEC 29500:2008 Strict compliance level is supported by Microsoft Office 2013 and Microsoft Office 2016. If you want to save document to strict compliance level , please use OoxmlSaveOptions.Compliance property as shown below.

OoxmlSaveOptions options = new OoxmlSaveOptions();
options.Compliance = OoxmlCompliance.Iso29500_2008_Strict;
document.Save(MyDir + @"18.3.docx", options);

Hi

Tried to compile the code but get errors with options.Compliance does not exist?

Regards, Mike

Hi

Solved the previous problem.

Regards, Mike

@mikesoffice,

Thanks for your feedback. It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Hi,
I nee to save PowerPoint and Excel in the same format do you have any code samples or documentation that helps, many thanks.
Regards, Mike

@mikesoffice,

In case of PowerPoint, the feature to manipulate Open Strict XML document is not available in Aspose.Slides API. A feature request has already been logged into our system with ID SLIDESNET-35568. We will update you here once there is some information or a fix version available in this regard.

For Excel, you may use Aspose.Cells to manipulate Open Strict XML document. Sample code snippet is given below for your reference.

CODE:

            var workbook = new Aspose.Cells.Workbook(inFile);
            workbook.Settings.IsDefaultEncrypted = false;
            var saveOptions = new Aspose.Cells.OoxmlSaveOptions(Aspose.Cells.SaveFormat.Xlsx);
            workbook.Save(outFile, saveOptions);

Hope the above information helps. Feel free to contact us in case of any query or comments.

hi

I have tried this code and it too fails

Regards Mike

@mikesoffice,

This issue has already been logged into our system with ID CELLSNET-46023 for further investigation. We will update you here once there is some information or a fix version available in this regard.

Hi

Any news on the ticket CELLSNET-46023 ???
Regards, Mike

@mikesoffice,

We are working on this issue. We will update you here as soon as there is some information or a fix version available in this regard.

@mikesoffice,

This is to inform you that we have fixed your issue “CELLSNET-46023” now. We will soon provide you the fix after performing QA and including other enhancements and fixes.

The issues you have found earlier (filed as CELLSNET-46023) have been fixed in this update. Please also check the document/article for your reference: https://docs.aspose.com/display/cellsnet/Installation

@mikesoffice

Please see the following sample code and screenshot for your reference. It explains how to save the Excel file in Strict Open XML Spreadsheet format.

C#

//Create workbook.
Workbook wb = new Workbook();

//Specify - Strict Open XML Spreadsheet.
wb.Settings.Compliance = OoxmlCompliance.Iso29500_2008_Strict;

//Save to output Excel file.
wb.Save("Out.xlsx");

Screenshot: