zoukankan      html  css  js  c++  java
  • word2010中统一调整表格格式

    word中统一调整表格格式基本思路是:
    1、选中所有的表格。
    2、再对表格格式调整。
      
    选中所有表格需要用到宏,操作很简单,具体操作如下:
    (1)工具栏“视图”下右下角“宏”。

      

    (2)点击,会出现下面的编辑框。

      

    (3)先填写宏名,可以叫“SelectAllTables”,单击创建,出弹出编辑框如下。
    (4)拷贝代码进去,放在“selectalltables宏”和“endsub”之间,代码如下:
    Dim tempTable As Table
       
       Application.ScreenUpdating = False
       
        '判断文档是否被保护
        If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
           MsgBox "文档已保护,此时不能选中多个表格!"
           Exit Sub
        End If
        '删除所有可编辑的区域
       ActiveDocument.DeleteAllEditableRanges wdEditorEveryone
        '添加可编辑区域
        For Each tempTable In ActiveDocument.Tables
           tempTable.Range.Editors.Add wdEditorEveryone
        Next
        '选中所有可编辑区域
       ActiveDocument.SelectAllEditableRanges wdEditorEveryone
        '删除所有可编辑的区域
       ActiveDocument.DeleteAllEditableRanges wdEditorEveryone
       
       Application.ScreenUpdating = True

    (5)拷贝后是这样的。

     (6)然后点击工具栏中的三角形,就是运行宏。

     (7)此时,文档中的表格就全选中了,就像调整一个表格一样调整就好了。

    更多内容及Java+大数据个人原创视频,可关注公众号观看:

    原创文章,转载请注明出处!!
  • 相关阅读:
    topcoder srm 445 div1
    topcoder srm 440 div1
    topcoder srm 435 div1
    topcoder srm 430 div1
    topcoder srm 400 div1
    topcoder srm 380 div1
    topcoder srm 370 div1
    topcoder srm 425 div1
    WKWebView强大的新特性
    Runtime那些事
  • 原文地址:https://www.cnblogs.com/dreamboy/p/14339304.html
Copyright © 2011-2022 走看看