问题
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