DOC or DOCX styles are not copied when converting to RTF

What is the correct way to convert docx -> rtf and preserve all docx styles in rtf output.

I’ve tried various loop iterations and even the following, which should copy all styles, but it doesn’t. No Heading 1, Heading 2 etc. is ever recognized in the RTF in Word.

Document rtf = new Document(outPath);
rtf.CopyStylesFromTemplate(docxPath);
rtf.Save(outPath + “.” + ext);

Any assistance would be very much appreciated, thanks.

@lee247,

The following simple C# code of latest (21.1) version of Aspose.Words for .NET API should preserve all Styles during Word DOCX to RTF conversions.

Document doc = new Document("C:\\Temp\\input.docx");
doc.Save(@"C:\Temp\output.rtf");

In case the problem still remains, then please ZIP and upload your input Word DOCX document, Aspose.Words generated RTF file and a comparison screenshot showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.