《word VBA全选文档内所有表格的代码.doc》由会员分享,可在线阅读,更多相关《word VBA全选文档内所有表格的代码.doc(1页珍藏版)》请在金锄头文库上搜索。
Sub 全选所有表格() 全选所有表格 MacroDim tempTable As TableApplication.ScreenUpdating = False判断文档是否被保护If ActiveDocument.ProtectionType = wdAllowOnlyFormFields ThenMsgBox 文档已保护,此时不能选中多个表格!Exit SubEnd If删除所有可编辑的区域ActiveDocument.DeleteAllEditableRanges wdEditorEveryone添加可编辑区域For Each tempTable In ActiveDocument.TablestempTable.Range.Editors.Add wdEditorEveryoneNext选中所有可编辑区域ActiveDocument.SelectAllEditableRanges wdEditorEveryone删除所有可编辑的区域ActiveDocument.DeleteAllEditableRanges wdEditorEveryoneApplication.ScreenUpdating = TrueEnd Sub