zoukankan      html  css  js  c++  java
  • word 批量修改表格格式

    For i = 1 To ActiveDocument.Tables.Count
    
     ActiveDocument.Tables(i).Cell(1, 1).Select
     With Selection
     .SelectRow
     .Font.Bold = True
     .Shading.BackgroundPatternColor = -603923969
    End With
     ActiveDocument.Tables(i).Range.Font.Size = 10
     Next
    

      宏内容:修改表格第一行字体为粗体,背景为浅灰色

    For i = 1 To ActiveDocument.Tables.Count
     ActiveDocument.Tables(i).Style = "my"
    Next
    

      宏内容:修改文档中所有的表格,使其表格样式为“my”的样式格式。

    For i = 1 To ActiveDocument.Tables.Count
     ActiveDocument.Tables(i).Style = "my"
    With With ActiveDocument.Tables(i).Range.ParagraphFormat
           .SpaceBeforeAuto = False
            .SpaceAfterAuto = False
            .LineSpacingRule = wdLineSpace1pt5
            .Alignment = wdAlignParagraphCenter
            .WidowControl = False
            .KeepWithNext = False
            .KeepTogether = False
            .PageBreakBefore = False
            .NoLineNumber = False
            .Hyphenation = True
            .FirstLineIndent = CentimetersToPoints(0)
            .OutlineLevel = wdOutlineLevelBodyText
            .CharacterUnitLeftIndent = 0
            .CharacterUnitRightIndent = 0
            .CharacterUnitFirstLineIndent = 0
            .MirrorIndents = False
            .TextboxTightWrap = wdTightNone
            .CollapsedByDefault = False
            .AutoAdjustRightIndent = True
            .DisableLineHeightGrid = False
            .FarEastLineBreakControl = True
            .WordWrap = True
            .HangingPunctuation = True
            .HalfWidthPunctuationOnTopOfLine = False
            .AddSpaceBetweenFarEastAndAlpha = True
            .AddSpaceBetweenFarEastAndDigit = True
            .BaseLineAlignment = wdBaselineAlignAuto
            End With
     Next

    宏内容:修改表格段落格式

  • 相关阅读:
    docker简单介绍----Dockerfile命令
    docker简单介绍----docker仓库的应用
    nginx实现https的配置文件
    docker简单介绍---网络端口管理
    mysql查看实时连接数
    linux 批量测试域名返回码脚本
    docker简单介绍----镜像和容器管理
    香冢
    GitHub 在使用命令行 git push 时报错:The requested URL returned error: 403
    守规矩应该被骂吗?
  • 原文地址:https://www.cnblogs.com/dorothychai/p/4012457.html
Copyright © 2011-2022 走看看