繁体   English   中英

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

[英]How can I change direction of the text in Word?

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

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

我认为您的意思是文本的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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM