2021年6月26日

[VBA] Word Table 自動列高

     Selection.Tables(1).Select

    WordBasic.TableRowHeight RulerStyle:=0, LineSpacingRule:=1, LineSpacing:= _

        "593.75", LeftIndent:="0.04", AllowRowSplit:=1, Alignment:=0, TableDir:=1

'以上是選擇固定行高

'593.75點


    WordBasic.TableRowHeight RulerStyle:=0, LineSpacingRule:=0, LeftIndent:= _

        "0.04", AllowRowSplit:=1, Alignment:=0, TableDir:=1

'以上是選擇自動行高


Sub 巨集3()

'

' 巨集3 巨集

' 巨集錄製於 2021/6/26,錄製者 jjtseng

'

    Selection.Tables(1).Select

    WordBasic.TableRowHeight RulerStyle:=0, LineSpacingRule:=1, LineSpacing:= _

        "593.75", LeftIndent:="0.04", AllowRowSplit:=1, Alignment:=0, TableDir:=1

    WordBasic.TableRowHeight RulerStyle:=0, LineSpacingRule:=0, LeftIndent:= _

        "0.04", AllowRowSplit:=1, Alignment:=0, TableDir:=1

    With Selection.ParagraphFormat

        .LeftIndent = CentimetersToPoints(0)

        .RightIndent = CentimetersToPoints(0)

        .SpaceBefore = 0

        .SpaceBeforeAuto = False

        .SpaceAfterAuto = False

        .LineSpacingRule = wdLineSpaceSingle

        .WidowControl = True

        .KeepWithNext = False

        .KeepTogether = False

        .PageBreakBefore = False

        .NoLineNumber = False

        .Hyphenation = True

        .FirstLineIndent = CentimetersToPoints(0)

        .OutlineLevel = wdOutlineLevelBodyText

        .CharacterUnitLeftIndent = 0

        .CharacterUnitRightIndent = 0

        .CharacterUnitFirstLineIndent = 0

        .LineUnitBefore = 0

        .ReadingOrder = wdReadingOrderLtr

        .AutoAdjustRightIndent = True

        .DisableLineHeightGrid = True

        .FarEastLineBreakControl = True

        .WordWrap = True

        .HangingPunctuation = True

        .HalfWidthPunctuationOnTopOfLine = False

        .AddSpaceBetweenFarEastAndAlpha = True

        .AddSpaceBetweenFarEastAndDigit = True

        .BaseLineAlignment = wdBaselineAlignAuto

    End With

    With Selection.ParagraphFormat

        .LeftIndent = CentimetersToPoints(0)

        .RightIndent = CentimetersToPoints(0)

        .SpaceBefore = 0

        .SpaceBeforeAuto = False

        .SpaceAfterAuto = False

        .LineSpacingRule = wdLineSpaceSingle

        .WidowControl = True

        .KeepWithNext = False

        .KeepTogether = False

        .PageBreakBefore = False

        .NoLineNumber = False

        .Hyphenation = True

        .FirstLineIndent = CentimetersToPoints(0)

        .OutlineLevel = wdOutlineLevelBodyText

        .CharacterUnitLeftIndent = 0

        .CharacterUnitRightIndent = 0

        .CharacterUnitFirstLineIndent = 0

        .LineUnitBefore = 0

        .ReadingOrder = wdReadingOrderLtr

        .AutoAdjustRightIndent = True

        .DisableLineHeightGrid = True

        .FarEastLineBreakControl = True

        .WordWrap = True

        .HangingPunctuation = True

        .HalfWidthPunctuationOnTopOfLine = False

        .AddSpaceBetweenFarEastAndAlpha = True

        .AddSpaceBetweenFarEastAndDigit = True

        .BaseLineAlignment = wdBaselineAlignAuto

    End With

End Sub

Sub 巨集4()

'

' 巨集4 巨集

' 巨集錄製於 2021/6/26,錄製者 jjtseng

'

    With Selection.ParagraphFormat

        .LeftIndent = CentimetersToPoints(0)

        .RightIndent = CentimetersToPoints(0)

        .SpaceBefore = 0

        .SpaceBeforeAuto = False

        .SpaceAfter = 0

        .SpaceAfterAuto = False

        .LineSpacingRule = wdLineSpaceSingle

        .WidowControl = True

        .KeepWithNext = False

        .KeepTogether = False

        .PageBreakBefore = False

        .NoLineNumber = False

        .Hyphenation = True

        .FirstLineIndent = CentimetersToPoints(0)

        .OutlineLevel = wdOutlineLevelBodyText

        .CharacterUnitLeftIndent = 0

        .CharacterUnitRightIndent = 0

        .CharacterUnitFirstLineIndent = 0

        .LineUnitBefore = 0

        .LineUnitAfter = 0

        .ReadingOrder = wdReadingOrderLtr

        .AutoAdjustRightIndent = True

        .DisableLineHeightGrid = True

        .FarEastLineBreakControl = True

        .WordWrap = True

        .HangingPunctuation = True

        .HalfWidthPunctuationOnTopOfLine = False

        .AddSpaceBetweenFarEastAndAlpha = True

        .AddSpaceBetweenFarEastAndDigit = True

        .BaseLineAlignment = wdBaselineAlignAuto

    End With

End Sub


沒有留言: