Microsoft Word —— 使用宏脚本将所有表格添加边框

简介: Microsoft Word —— 使用宏脚本将所有表格添加边框

前言

写文档写废掉了

内容

宏脚本内容

Sub 宏1()
'
' 宏1 宏
'
'
For Each aTable In ActiveDocument.Tables
'    aTable.Borders.OutsideLineStyle = wdLineStyleSingle
'    aTable.Borders.OutsideLineWidth = wdLineWidth025pt
'
''    aTable.Borders.InsideLineStyle = wdLineStyleSingle
''    aTable.Borders.InsideLineStyle = wdLineWidth025pt
    With aTable
        aTable.Select
        With .Borders(wdBorderLeft)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth050pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderRight)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth050pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderTop)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth050pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderBottom)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth050pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderHorizontal)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth050pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderVertical)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth050pt
            .Color = wdColorAutomatic
        End With
        .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
        .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
        .Borders.Shadow = False
    End With
    With Options
        .DefaultBorderLineStyle = wdLineStyleSingle
        .DefaultBorderLineWidth = wdLineWidth050pt
        .DefaultBorderColor = wdColorAutomatic
    End With
Next aTable
End Sub

运行脚本

视图->宏->查看宏->编辑->粘贴脚本->运行

学无止境,谦卑而行.

目录
相关文章
|
JavaScript 前端开发
VUE3(三十六)压缩base64格式图片
VUE3(三十六)压缩base64格式图片
1135 0
|
存储 Linux Android开发
Rockchip系列之VendorStorage uboot/kernel/user space 阶段接口使用介绍(2)
Rockchip系列之VendorStorage uboot/kernel/user space 阶段接口使用介绍(2)
2362 0
|
编解码 物联网 API
"揭秘SD文生图的神秘面纱:从选择模型到生成图像,一键解锁你的创意图像世界,你敢来挑战吗?"
【10月更文挑战第14天】Stable Diffusion(SD)文生图功能让用户通过文字描述生成复杂图像。过程包括:选择合适的SD模型(如二次元、2.5D、写实等),编写精准的提示词(正向和反向提示词),设置参数(迭代步数、采样方法、分辨率等),并调用API生成图像。示例代码展示了如何使用Python实现这一过程。
1041 4
|
域名解析 弹性计算 安全
阿里云服务器安装宝塔面板、安装网站(新手图文教程)
本文详细介绍了从注册阿里云账号到使用宝塔面板安装网站的完整流程,包括阿里云账号的企业认证、服务器购买与安全规则配置、宝塔面板的安装及网站部署等步骤。通过图文并茂的方式,帮助用户轻松完成阿里云服务器的搭建和管理。适合新手快速上手,实现网站从零到有的全过程。如果觉得有用,别忘了点赞收藏!
11034 3
阿里云服务器安装宝塔面板、安装网站(新手图文教程)
|
安全 开发者
在HTTPS安全页面中加载HTTP不安全的内容,如何绕过安全警告?
在HTTPS安全页面中加载HTTP不安全的内容,如何绕过安全警告?
1491 0
|
存储 监控 应用服务中间件
服务器硬件基础知识
服务器硬件基础知识
|
SQL 关系型数据库 MySQL
解决 MySQL 5.7 及以上版本中的 “ONLY_FULL_GROUP_BY“ 错误
解决 MySQL 5.7 及以上版本中的 “ONLY_FULL_GROUP_BY“ 错误
2865 3
|
人工智能 API
开源大模型与大模型api的使用优缺点
【5月更文挑战第26天】开源大模型与大模型api的使用优缺点
2936 1
|
数据采集 机器学习/深度学习 人工智能
【机器学习】在使用K-means算法之前,如何预处理数据?
【5月更文挑战第12天】【机器学习】在使用K-means算法之前,如何预处理数据?
|
监控 安全 前端开发
《VitePress 简易速速上手小册》第10章 维护与更新(2024 最新版)
《VitePress 简易速速上手小册》第10章 维护与更新(2024 最新版)
728 2

热门文章

最新文章