狂自私

导航

调整表格为自己喜欢的样式

Sub 调整表格为自己喜欢的样式()
'
' 表格左对齐 宏
' 且文字环绕
    Application.ScreenUpdating = False                          '关闭同步调整更新
    Dim mytable As Table, i As Long
    For Each mytable In ActiveDocument.Tables
        mytable.Style = "网格型"                   '调整表格样式
        mytable.Rows.Alignment = wdAlignRowLeft     '行左对齐
        mytable.Rows.WrapAroundText = False         '文字环绕
        mytable.AutoFitBehavior (wdAutoFitContent)  '根据内容自动调整
        mytable.AutoFitBehavior (wdAutoFitWindow)   '根据窗口自动调整
        mytable.Select
        Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft      '设置当前选定内容的段落格式设置为左对齐
    Next
    Application.ScreenUpdating = True                          '开启同步调整更新
End Sub

 

posted on 2024-05-26 08:43  狂自私  阅读(17)  评论(0)    收藏  举报