您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > Word几个实用宏解决方案
Sub自动编号改为手动编号()ActiveDocument.Content.ListFormat.ConvertNumbersToTextEndSubSub批量去除域()ActiveDocument.Content.Fields.UnlinkEndSubSubCenterPara()'绝对居中(中国式居中)WithSelection.ParagraphFormat.CharacterUnitFirstLineIndent=0.FirstLineIndent=0.CharacterUnitLeftIndent=0.LeftIndent=0.CharacterUnitRightIndent=0.RightIndent=0.Alignment=wdAlignParagraphCenterEndWithEndSubSub选中所有的表格()DimtempTableAsTableApplication.ScreenUpdating=FalseIfActiveDocument.ProtectionType=wdAllowOnlyFormFieldsThenMsgBox文档已保护+填写窗体,此时不能选中多个表格ExitSubEndIfActiveDocument.DeleteAllEditableRangeswdEditorEveryoneForEachtempTableInActiveDocument.TablestempTable.Range.Editors.AddwdEditorEveryoneNextActiveDocument.SelectAllEditableRangeswdEditorEveryoneActiveDocument.DeleteAllEditableRangeswdEditorEveryoneApplication.ScreenUpdating=TrueEndSubSub文本反选()'对常规文本进行反选DimmyRangeAsRange,oEditorAsEditorOnErrorResumeNextIfApplication.Version11ThenMsgBox版本过低!ExitSubEndIfIfActiveDocument.Range(ActiveDocument.Range.End-1,_ActiveDocument.Range.End).Font.Hidden=TrueThenMsgBox文档最后的段落标记不能设置为隐藏文字ExitSubEndIfIfActiveDocument.Range.Font.HiddenFalseThenMsgBox此文档有隐藏文字ExitSubEndIfIfActiveDocument.ProtectionTypewdNoProtectionThenMsgBox文档处于保护状态ExitSubEndIfIfSelection.TypewdSelectionNormalThenMsgBox所选内容为非常规文本ExitSubEndIfApplication.ScreenUpdating=FalseWithActiveDocument.Range.Font.Hidden=False.DeleteAllEditableRanges(wdEditorEveryone)Application.ScreenUpdating=False.ActiveWindow.View.ShowHiddenText=True.Content.Editors.AddwdEditorEveryoneSelection.Font.Hidden=TrueGN:SetmyRange=.ContentWithmyRange.Find.ClearFormatting.Font.Hidden=TrueDoWhile.Execute=TruemyRange.SelectmyRange.Editors(wdEditorEveryone).DeletemyRange.Font.Hidden=FalseGoToGNLoopEndWith.ActiveWindow.View.ShadeEditableRanges=False.SelectAllEditableRanges(wdEditorEveryone).DeleteAllEditableRanges(wdEditorEveryone)EndWithApplication.ScreenUpdating=TrueEndSub
本文标题:Word几个实用宏解决方案
链接地址:https://www.777doc.com/doc-3597198 .html