How to align cell content (InlineShape) to the right?

流过昼夜 提交于 2021-01-28 10:49:41

问题


I am using C# to programmatically create a word document (Office 16.0 Interop).

In the header section of the document I added a table of which one cell contains a picture. However, I can't get the picture to align to the right within the cell. It is left aligned by default (as it should be).

Oddly enough, cells have a VerticalAlignment property of type WdCellVerticalAlignment but seem to lack a property for horizontal alignment.

How can I align an InlineShape within a cell to the right?


回答1:


It's fairly simple once you know the object you are trying to align:

cell.Range.ParagraphFormat.Alignment = Word.wdAlignParagraphRight


来源:https://stackoverflow.com/questions/45079674/how-to-align-cell-content-inlineshape-to-the-right

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!