如何在Word中批量修改表格的格式
时间:2022-11-16 03:20:41
1)建立宏来选择文档中的全部表格:「开发工具」-「Visual Basic」将下列代码复制进去。然后,在「宏」中点击「运行」,就可以选中文档中的所有表格了。
代码:
Sub 批量修改表格()
Dim tempTable As Table
Application.ScreenUpdating = False
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
MsgBox "文档已保护,此时不能选中多个表格!"
Exit Sub
End If
ActiveDocument.DeleteAllEditableRanges wdEditorEveryone
For Each tempTable In ActiveDocument.Tables
tempTable.Range.Editors.Add wdEditorEveryone
Next
ActiveDocument.SelectAllEditableRanges wdEditorEveryone
ActiveDocument.DeleteAllEditableRanges wdEditorEveryone
Application.ScreenUpdating = True
End Sub
2)修改表格属性。通过上面的宏选中表格后,还可以通过「右键」-「表格属性」,对表格中的单元格的高度、宽度等再次统一设置。
3)修改样式:运行刚才录入进去的宏,即可一次选中文档中所有表格,然后,可以在「设计」-「表格样式」-「修改表格样式」。
标签:如,何在,Word,中,批量,修改,表格,的,格式,建立
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
office2019怎么添加误差线? 图表添加误差线的技巧
2023-08-17 09:19:58
![](https://img.aspxhome.com/file/2023/8/15758_0s.jpg)
WPS如何为表格添加底纹颜色
2023-05-25 05:00:17
如何给word 2013文档图片设置样式效果
2022-03-20 02:09:14
![](https://img.aspxhome.com/file/2023/6/32866_0s.jpg)
word 2007如何添加插入目录
2023-07-21 16:14:36
![](https://img.aspxhome.com/file/2023/3/33663_0s.jpg)
忘记 iTunes 加密备份密码怎么办?
2023-11-17 05:20:09
![](https://img.aspxhome.com/file/2023/6/46226_0s.png)
iOS 14 AirPods 新功能预览:空间音频、自动设备切换,低电量通知……
2023-12-07 20:04:40
![](https://img.aspxhome.com/file/2023/1/a194821_0s.png)
快速教你如何使用Excel2010重排窗口 数据轻松调用
2022-10-08 05:45:03
![](https://img.aspxhome.com/file/2023/0/30030_0s.jpg)
word 产生空白页的五种方法并加以删除
2023-02-05 22:40:49
![](https://img.aspxhome.com/file/2023/6/33146_0s.jpg)
Win10电脑怎么设置定时关机?电脑定时关机设置步骤
2023-11-24 00:22:30
![](https://img.aspxhome.com/file/2023/2/50512_0s.png)
笔记本wifi连上又断开再连又断是为什么?
2023-06-10 15:23:55
![](https://img.aspxhome.com/file/2023/2/53322_0s.jpg)
WORD中轻松选择多个图形的技巧
2023-08-08 18:17:55
![](https://img.aspxhome.com/file/2023/8/24918_0s.png)
Offie2019鼠标拖动窗口十分卡顿?Offie2019卡顿解决方法分享
2023-09-07 10:05:45
![](https://img.aspxhome.com/file/2023/3/15933_0s.jpg)
Office 2016预览版首次更新:增加一大批新功能
2023-08-11 10:05:42
![](https://img.aspxhome.com/file/2023/9/15539_0s.jpg)
Word2013中文双引号总是变成英文双引号怎么办?
2023-07-05 08:12:05
![](https://img.aspxhome.com/file/2023/0/28640_0s.jpg)
Word空白页怎么删除不了?Word快速删除空白段落详细教程
2023-04-11 11:42:19
![](https://img.aspxhome.com/file/2023/4/22654_0s.jpg)
word2007为什么不能输入中文?如何解决
2022-06-07 06:07:37
![](https://img.aspxhome.com/file/2023/8/21118_0s.jpg)
编写简单宏代码 快速打开Word文档
2023-06-29 04:33:25
word表格中出现下划线该怎么删除?
2023-11-06 09:43:51
![](https://img.aspxhome.com/file/2023/7/24437_0s.jpg)
Word怎么批量复制粘贴格式 Word批量复制粘贴格式教程
2023-09-29 21:41:55
![](https://img.aspxhome.com/file/2023/9/24659_0s.jpg)
Word中批注怎么添加?Word中添加批注的方法
2022-08-23 09:47:36
![](https://img.aspxhome.com/file/2023/7/31107_0s.jpg)