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

运行脚本

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

学无止境,谦卑而行.

目录
相关文章
|
存储 Kubernetes 监控
K8S核心组件介绍
K8S核心组件介绍
|
存储 Linux Android开发
Rockchip系列之VendorStorage uboot/kernel/user space 阶段接口使用介绍(2)
Rockchip系列之VendorStorage uboot/kernel/user space 阶段接口使用介绍(2)
2121 0
|
5月前
|
机器学习/深度学习 人工智能 Java
实测对比:企业落地的主流 AI 开发框架测评
本文以中立、客观、可落地为原则,实测对比JBoltAI、LangChain、Spring AI等主流AI框架,聚焦Java企业适配性、国产模型支持、工程化能力及存量系统改造难度,提供清晰选型建议。(239字)
348 0
|
编解码 物联网 API
"揭秘SD文生图的神秘面纱:从选择模型到生成图像,一键解锁你的创意图像世界,你敢来挑战吗?"
【10月更文挑战第14天】Stable Diffusion(SD)文生图功能让用户通过文字描述生成复杂图像。过程包括:选择合适的SD模型(如二次元、2.5D、写实等),编写精准的提示词(正向和反向提示词),设置参数(迭代步数、采样方法、分辨率等),并调用API生成图像。示例代码展示了如何使用Python实现这一过程。
940 4
|
人工智能 自然语言处理 算法
蔚来汽车携手通义灵码入选 2025 世界人工智能大会标杆案例
在2025年世界人工智能大会上,通义灵码助力蔚来汽车提升研发效能,成功入选“人工智能+”行业标杆案例。蔚来已有近1000名工程师常态化使用该工具,AI生成代码占比超30%,在“天探”系统中更达70%,显著提升开发效率与代码质量,并正向更多核心领域扩展。
|
域名解析 弹性计算 安全
阿里云服务器安装宝塔面板、安装网站(新手图文教程)
本文详细介绍了从注册阿里云账号到使用宝塔面板安装网站的完整流程,包括阿里云账号的企业认证、服务器购买与安全规则配置、宝塔面板的安装及网站部署等步骤。通过图文并茂的方式,帮助用户轻松完成阿里云服务器的搭建和管理。适合新手快速上手,实现网站从零到有的全过程。如果觉得有用,别忘了点赞收藏!
10610 3
阿里云服务器安装宝塔面板、安装网站(新手图文教程)
|
安全 开发者
在HTTPS安全页面中加载HTTP不安全的内容,如何绕过安全警告?
在HTTPS安全页面中加载HTTP不安全的内容,如何绕过安全警告?
1388 0
|
运维 Linux 数据安全/隐私保护
linux配置SVN,添加用户,配置用户组的各个权限教程
linux配置SVN,添加用户,配置用户组的各个权限教程
|
存储 监控 应用服务中间件
服务器硬件基础知识
服务器硬件基础知识
|
人工智能 API
开源大模型与大模型api的使用优缺点
【5月更文挑战第26天】开源大模型与大模型api的使用优缺点
2800 1