1

I've been struggling in the last few days, trying to write a Word document. I've tried downloading DocX by (Novacode) which was not a big success, then moved to Microsoft.Office.Interop.Word library which was better but still, not a huge success.

The problem is that I'm trying to write a Right-To-Left document, which is of course mixed with different punctuation. The moment I add punctuation the entire line is reversed.

I get many lines written from Database, write them the way they are in the document, and I can not manipulate them, unlike titles and stuff, which I can manipulate, reverse stuff and get the lines the way I want, after struggling.

I've seen some answers saying I should use a specific char which 'tells' the reading algorithm it is about to face a Right-To-Left line, but here most data is derived from database.

Has anyone faced that kind of problem and can give some advices?

1
  • 1
    not standard solution, is to create HTML page/file and rename extension to be .doc
    – Michael B.
    Aug 20, 2014 at 9:36

2 Answers 2

1

To whoever finds it relevant, and none of the above helped, I found this answer the best for Right-To-Left documents:

oDoc.Paragraphs.ReadingOrder = Word.WdReadingOrder.wdReadingOrderRtl;
0

Did you try with the Open XML SDK and using the BiDi class?

http://msdn.microsoft.com/en-us/library/dd452407(v=office.12).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.