word 使用宏批量设置表格


Sub ChangeTable()

Application.Browser.Target = wdBrowseTable

    For i = 1 To ActiveDocument.Tables.Count

        ActiveDocument.Tables.Item(i).Select

        With Selection
    
            '表格外边框
            .Borders.OutsideLineStyle = wdLineStyleSingle
            '表格内边框
            .Borders.InsideLineStyle = wdLineStyleSingle
            '表格内边框
            .Borders(wdBorderRight).Color = wdColorAutomatic
            .Borders(wdBorderLeft).Color = wdColorAutomatic
            .Borders(wdBorderTop).Color = wdColorAutomatic
            .Borders(wdBorderBottom).Color = wdColorAutomatic
            '表格居中
            .Rows.Alignment = wdAlignRowLeft
            '表格内容居中
            .Range.Paragraphs.Alignment = wdAlignParagraphLeft
            
        End With
    
    Next i

End Sub

 

相关链接:http://blog.chinaunix.net/uid-20423564-id-1949478.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM