Dzwebs.Net

撰写电脑技术杂文十余年

VBA选择WORD多个表格、操作编辑区域的代码

Admin | 2013-12-23 9:10:15 | 被阅次数 | 8768

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  选择多个文档的代码  

  Sub SelectAllTables()

  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


该杂文来自: Word杂文

上一篇:word如何指定输入法、控制设置默认输入法、切换输

下一篇:粘贴无格式文本到word的快捷键制作方法

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计