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

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

  • 相关阅读:
    iOS必备知识点
    stringByReplacingOccurrencesOfString
    iPhone X 设计适配指南 & iOS 11 新特性
    block与property
    swift开发笔记04
    category重写系统方法的调用顺序是怎么样的?
    Error: Chunk.entry was removed. Use hasRuntime()错误解决
    李阳音标速成MP3文本
    JavaScript权威指南(第6版)(中文版)笔记
    Idea检入boss项目
  • 原文地址:https://www.cnblogs.com/dorothychai/p/4012457.html
Copyright © 2011-2022 走看看