我們如何使用 VBA 在 Microsoft Word 的尾注中僅格式化表格?
如果我們使用這段代碼:
Sub FormatTableDemo()
Application.ScreenUpdating = False
Dim Tbl As Table
For Each Tbl In ActiveDocument.Tables
With Tbl
.AllowAutoFit = False
.Rows.Alignment = wdAlignRowCenter
.Range.Cells.VerticalAlignment = wdCellAlignVerticalTop
.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Rows(1).Cells.VerticalAlignment = wdCellAlignVerticalCenter
.Rows(1).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Columns(1).Width = CentimetersToPoints(0.95)
.Columns(2).Width = CentimetersToPoints(0.95)
.Columns(3).Width = CentimetersToPoints(7#)
.Columns(4).Width = CentimetersToPoints(6#)
End With
Next
Application.ScreenUpdating = True
End Sub
我們只格式化所有表格(不是尾注表格)
uj5u.com熱心網友回復:
這很簡單:
For Each Tbl In ActiveDocument.StoryRanges(wdEndnotesStory).Tables
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/486703.html
上一篇:處理字串和復制粘貼變數