我使用Microsoft.Office.Interop.Word在C#中创建Word文档
我想在rtl(RightToLeft)方向上显示我的阿拉伯文字。如何将文本方向设置为rtl?
在下面的代码中,我更改了Alighnment,但无法更改方向。请帮我!
Word.Application wordApp = new Word.Application();
object objMissing = System.Reflection.Missing.Value;
Word.Document wordDoc = wordApp.Documents.Add(ref objMissing, ref objMissing, ref objMissing, ref objMissing);
Word.Paragraph wordParagraph = wordDoc.Paragraphs.Add(ref objMissing);
wordParagraph.Range.Font.Name = "B Titr";
wordParagraph.Range.Font.Size = 14;
WordParagraph.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphRight;
wordParagraph.Range.Text = "My Arabic text";
wordParagraph.Range.InsertParagraphAfter();
最佳答案
你有尝试过吗?
wordParagraph.ReadingOrder = WdReadingOrder.wdReadingOrderRtl;
关于c# - 如何在C#中的MS Word文档中设置文本方向RightToLeft?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11241844/