如何使用VBA在Microsoft Word中的endNotes上格式化表?
我们如何使用VBA在Microsoft Word中仅在endNotes上格式化表?
如果我们使用此代码:
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
我们仅格式化所有表(不是endnote表)
How can we use VBA to format only tables at endnotes in Microsoft Word?
If we use this code:
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
We only format all tables (not endnote tables)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
那很简单:
That's as simple as: