返回首页
当前位置: 主页 > 精通Office > Word教程 >

Word 文档整理中常用操作的宏代码

时间:2012-11-05 19:48来源:知行网www.zhixing123.cn 编辑:麦田守望者

Sub 绝对居中()
'
' 绝对居中 宏
'
'
 Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)
 Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
End Sub

Sub DEL中文空格()
'
' DEL中文空格 宏
'
'
 Selection.Find.ClearFormatting
 Selection.Find.Replacement.ClearFormatting
 With Selection.Find
 .Text = " "
 .Replacement.Text = ""
 .Forward = True
 .Wrap = wdFindContinue
 .Format = False
 .MatchCase = False
 .MatchWholeWord = False
 .MatchByte = True
 .MatchWildcards = False
 .MatchSoundsLike = False
 .MatchAllWordForms = False
 End With
 Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Sub 学研端批量删除英文空格()
'
' 学研端批量删除英文空格 宏
'
'
 Selection.Find.ClearFormatting
 Selection.Find.Replacement.ClearFormatting
 With Selection.Find
 .Text = " "
 .Replacement.Text = ""
 .Forward = True
 .Wrap = wdFindContinue
 .Format = False
 .MatchCase = False
 .MatchWholeWord = False
 .MatchByte = True
 .MatchWildcards = False
 .MatchSoundsLike = False
 .MatchAllWordForms = False
 End With
 Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Sub 将手动换行符替换为换行符()
'
' 将手动换行符替换为换行符(Designed by xyduan.net) 宏
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^l"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchByte = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
 

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
标签(Tag):Word Word2007 Word2003 Word2010 Word教程 Word技巧 word2010教程 word2010技巧
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片
猜你感兴趣