C # OpenXML (Word) AutoFit to Window Table

Open a Word document (2007/2010) that has a table, select the table and right-click, select AutoFit β†’ AutoFit to Window

How can I implement this action in C # using the OpenXML SDK 2.5?

+4
source share
1 answer

You can set the width of the table to 100% of the page or 5000 fifties as a percentage.

Table table = ... TableWidth width = table.GetDescendents<TableWidth>().First(); width.Width = "5000"; width.Type = TableWidthUnitValues.Pct; 
+7
source

Source: https://habr.com/ru/post/1495030/


All Articles