We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Fields are Lost when Document is Opened in WordPad | DOCX to RTF Conversion using .NET

Hello Aspose,
I’ve converted input.docx into an RTF file using the following code snippets:

        var source = "..\\..\\input.docx";
        var document = new Document(source);

        if (document.HasRevisions)
        {
            document.AcceptAllRevisions();
        }

        document.UpdateFields();
        document.Save("output.rtf", SaveFormat.Rtf);
        Console.WriteLine("Saved");

Some fields in the saved RTF file don’t have the most recent calculated result, \fldrslt does not have any value.

{\field{*\fldinst{\rtlch\af1\alang1025\afs22\ltrch\fs22\lang1033\langnp1033\langfe1033\langfenp1033\loch\af0\dbch\af0\hich\f0 LISTNUM }}{\fldrslt}}

{\field{*\fldinst{\rtlch\af1\alang1025\afs22\ltrch\fs22\lang1033\langnp1033\langfe1033\langfenp1033\loch\af0\dbch\af0\hich\f0 AUTONUMLGL }}{\fldrslt}}

{\field{*\fldinst{\rtlch\af1\alang1025\afs22\ltrch\fs22\lang1033\langnp1033\langfe1033\langfenp1033\loch\af0\dbch\af0\hich\f0 AUTONUM }}{\fldrslt}}

There is how WordPad shows these fields:
image.png (4.9 KB)

Preformatted textAccording to Rich Text Format (RTF) Specification, Version 1.9.1, fields, the \fldrslt control word should be included even if a result was not calculated because most readers (even those readers that do not recognize fields) can generally include the value of the \fldrslt destination in the document.

A sample app:
DOCXTORTF.zip (24.6 KB)

Many thanks,
Ievgenii Bukhinnyk.

@licenses

We have managed to reproduce the same issue at our side and logged it in our issue tracking system as WORDSNET-22601. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-22601) have been fixed in this Aspose.Words for .NET 21.9 update.