文檔金喜正規買球>>Aspose中文文檔>>使所有表格適合頁面寬度
使所有表格適合頁面寬度
Aspose.Words是一種高級Word文檔處理API,用于執行各種文檔管理和操作任務。API支持生成,修改,轉換,呈現和打印文檔,而無需在跨平臺應用程序中直接使用Microsoft Word。
Aspose API支持流行文件格式處理,并允許將各類文檔導出或轉換為固定布局文件格式和最常用的圖像/多媒體格式。
VSTO
string mypath = "Document.docx"; Word.Application wordApp = Application; wordApp.Documents.Open(mypath); foreach (Table table in this.Application.ActiveDocument.Tables) { table.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent; table.PreferredWidth = 100; }
點擊復制
Aspose.Words
Document doc = new Document( "doc.docx"); foreach (Table table in doc.GetChildNodes(NodeType.Table, true)) { table.PreferredWidth = PreferredWidth.FromPercent(100); }
點擊復制
下載示例代碼