• 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
    
    
    

    运行脚本

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

  • 相关阅读:
    网络通信之 字节序转换原理与网络字节序、大端和小端模式
    [C/C++]大小端字节序转换程序
    面向对象和面向过程的区别
    编译libjpeg
    地形系统lod
    c/c++ 代码中使用sse指令集加速
    个人作品- 蘑菇大战
    个人作品- 几何战争
    Obj格式模型 读取
    各大引擎矩阵的矩阵存储方式 ----行矩阵 or 列矩阵
  • 原文地址:https://www.cnblogs.com/wangyang0210/p/14034584.html
Copyright © 2020-2023  润新知