When the exported document contains a very precise indent values, these are saved using scientific notation, which is unsupported in MS Word. Opening the file in Word results in the following error: "Word experienced an error trying to open the file."
Here is an example of the troublesome setting in the body of the produced document:
<w:ind w:firstLine="6.420405952667352E-06" w:left="76.53543090820312" w:right="0" />
To work this around, you can open the exported document with the WordsProcessing library. This will give you a RadFlowDocument object which then can be exported to a file again. This will save the indent values properly in the new document.
var dplProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
using (var inputStream = File.OpenRead("../../../originalFile.docx"))
{
Telerik.Windows.Documents.Flow.Model.RadFlowDocument flowDoc = dplProvider.Import(inputStream, TimeSpan.FromSeconds(5));
using (var outputStream = File.OpenWrite("../../../convertedFile.docx"))
{
dplProvider.Export(flowDoc, outputStream, TimeSpan.FromSeconds(5));
}
}
Or if you use the RichTextBox document model only to create documents in code (without using the RadRichTextBox control), you can replace the code with the WordsProcessing API.