我使用 Microsoft.Office.Interop.Word 在 c# 中创建了一个 word 文档。
我想要以从右到左的 rtl 方向显示我的阿拉伯文本。如何设置文本方向为 rtl?
在下面的代码中,我改变了对齐方式,但我无法改变方向。请帮帮我!
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();