如何更改Word中文本的方向?

时间:2012-01-04 10:06:04

标签: c# c#-4.0 ms-word

我有一个项目,我想改变MS Word格式的文本方向。在我的项目中,我使用了Microsoft.Office.Interop.Word,您有什么经历?

2 个答案:

答案 0 :(得分:0)

Word.Application w= new Word.Application();
object objMissing = System.Reflection.Missing.Value;
Word.Paragraph wp= w.Paragraphs.Add(ref objMissing);
wp.ReadingOrder = WdReadingOrder.wdReadingOrderRtl;

答案 1 :(得分:0)

我认为您的意思是Orientation或实际上是Range,您可以像这样更改它:

document.Words.Last.Orientation = Word.WdTextOrientation.wdTextOrientationDownward;

或表格的单元格:

table.Rows[1].Cells[1].Range.Orientation = Word.WdTextOrientation.wdTextOrientationUpward;

Word.WdTextOrientation枚举值低于以下值:

wdTextOrientationDownward
wdTextOrientationHorizontal
WdTextOrientation.wdTextOrientationHorizontalRotatedFarEast
WdTextOrientation.wdTextOrientationUpward
WdTextOrientation.wdTextOrientationVertical
WdTextOrientation.wdTextOrientationVerticalFarEast