【发布时间】:2013-08-03 04:59:38
【问题描述】:
打开一个包含表格的 Word (2007/2010) 文档,选择表格并右键单击,选择 AutoFit-->AutoFit to Window
如何使用 OpenXML SDK 2.5 在 C# 中实现此操作?
【问题讨论】:
-
我已经尝试过使用生产力工具,但没有成功。
标签: c# ms-word openxml openxml-sdk
打开一个包含表格的 Word (2007/2010) 文档,选择表格并右键单击,选择 AutoFit-->AutoFit to Window
如何使用 OpenXML SDK 2.5 在 C# 中实现此操作?
【问题讨论】:
标签: c# ms-word openxml openxml-sdk
您可以将表格的宽度设置为页面的 100%,或 5000 个百分比。
Table table = ...
TableWidth width = table.GetDescendents<TableWidth>().First();
width.Width = "5000";
width.Type = TableWidthUnitValues.Pct;
【讨论】: