PA.*_*PA. 5 microsoft-office vba microsoft-word-2003 microsoft-word
我有一堆大文档,其中许多表格具有不同且不一致的填充样式 - 其中一些在打印时无法以黑白方式读取。
我无法一次更改所有表格的背景填充。我遇到的问题是,当我打开这样的文档并全选时,表属性处于非活动状态。
您是否知道使用脚本或其他方式选择所有表格的技术,或应用表格全局格式的方法?
使用以下代码在 Word 中创建宏:
Sub SelectAllTables()
Dim tbl As Table
Application.ScreenUpdating = False
For Each tbl In ActiveDocument.Tables
tbl.Range.Editors.Add wdEditorEveryone
Next
ActiveDocument.SelectAllEditableRanges (wdEditorEveryone)
ActiveDocument.DeleteAllEditableRanges (wdEditorEveryone)
Application.ScreenUpdating = True
End Sub
Run Code Online (Sandbox Code Playgroud)
运行宏选择所有表格,然后就可以一次性修改它们的背景。
| 归档时间: |
|
| 查看次数: |
1883 次 |
| 最近记录: |