Tôi tạo tài liệu từ bằng C# với Microsoft.Office.Interop.WordLàm thế nào tôi có thể đặt hướng văn bản RightToLeft trong tài liệu từ ms trong C#?
Tôi muốn hiển thị văn bản tiếng Ả Rập theo hướng rtl (RightToLeft). Làm thế nào tôi có thể thiết lập hướng văn bản để rtl?
Trong mã dưới đây của tôi, tôi thay đổi Alighnment, Nhưng tôi không thể thay đổi hướng. Làm ơn giúp tôi!
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();
Vâng, nhưng nó vẫn LeftToRight! –
@ a_ahmadi: tôi có cùng một vấn đề, bạn có tìm được giải pháp không? –
Tôi sử dụng điều này: wordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphRight; –