Im running version 9.4.0 of Aspose.Words.
I run this code as a workaround for the lack of support fore soft hyphenation i Aspose.Words:
Document doc = new Document(file.FullName, new Aspose.Words.LoadOptions());
doc.Range.Replace(((char)31).ToString(), “”, false, false);
In one of my documents this method throws the exeption :
Test method TrossenUtskickTestProject.FileConverterTest.DocToOutputFormatTest threw exception: System.InvalidCastException: Unable to cast object of type ‘Aspose.Words.SpecialChar’ to type ‘Aspose.Words.Run’.
I have narrowed the problem down to the word “tillämpning” on page 8, line 1. If I remove that word the code runs ok.
Edit: I now see that an alternative to the regular soft hyphen is used. The two syllables “till” and “lämpning” put together would result i three L´s and that´s not allowed in the Swedish language. This special charachter removes one L in the cases the two syllabels are put together on the same line.
It´s hard to express these things in English, but I´m doing my best.