Word宏代码集锦.docx

上传人:b****6 文档编号:3255016 上传时间:2022-11-21 格式:DOCX 页数:49 大小:27.52KB
下载 相关 举报
Word宏代码集锦.docx_第1页
第1页 / 共49页
Word宏代码集锦.docx_第2页
第2页 / 共49页
Word宏代码集锦.docx_第3页
第3页 / 共49页
Word宏代码集锦.docx_第4页
第4页 / 共49页
Word宏代码集锦.docx_第5页
第5页 / 共49页
点击查看更多>>
下载资源
资源描述

Word宏代码集锦.docx

《Word宏代码集锦.docx》由会员分享,可在线阅读,更多相关《Word宏代码集锦.docx(49页珍藏版)》请在冰豆网上搜索。

Word宏代码集锦.docx

Word宏代码集锦

Word宏代码集锦

 

一、    修改word格式:

1、' 智能清除选区软回车(换行符)

Sub 智能清除选区软回车()

        WithSelection.Find

        .Text="?

^l"

        .Replacement.Text="^&^p"

        .Forward=True

        .Wrap=wdFindContinue

        .Format=False

        .MatchCase=False

        .MatchWholeWord=False

        .MatchByte=False

        .MatchAllWordForms=False

        .MatchSoundsLike=False

        .MatchWildcards=True

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^1^l"

        .Replacement.Text="^&^p"

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^l"

        .Replacement.Text=""

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

EndSub

 

2、' 清除选区多余空段

Sub 清除选区多余空段()

    WithSelection.Find

        .Text="^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.Find

        .Text="^p^p"

        .Replacement.Text="^p"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

EndSub

 

3、' 合并选区中“,”结束的多余分段

Sub 合并选区多余分段()

    WithSelection.Find

        .Text=",^p"

        .Replacement.Text=","

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

 

    WithSelection.Find

        .Text="、^p"

        .Replacement.Text="、"

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

 

EndSub

 

 

4、' 清除选区单字节空格

Sub 清除选区单字节空格()

 

   

    WithSelection.Find

        .Text=""

        .Replacement.Text=""

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

 

EndSub

 

5、' 清除选区单字节空格

Sub 清除选区2单字节空格()

    WithSelection.Find

        .Text="  "

        .Replacement.Text=""

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

EndSub

 

6、' 清除选区1字空格

Sub 清除选区1字空格()

    WithSelection.Find

        .Text=" "

        .Replacement.Text=""

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

 

EndSub

 

7、' 清除选区段首2字空格

Sub 清除选区段首2字空格()

   

    WithSelection.Find

        .Text="  "

        .Replacement.Text=""

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

 

EndSub

 

8、' 清除选区Tab

Sub 清除选区Tab()

    WithSelection.Find

        .Text=vbTab

        .Replacement.Text=""

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

 

EndSub

 

9、' 增加选区空格

Sub 增加选区空格()

    WithSelection.Find

        .Text=" "

        .Replacement.Text="  "

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

EndSub

 

10、' 选区段首缩进0字

Sub 选区段首无缩进()

WithSelection.Find

        .Text=" "

        .Replacement.Text=""

        .MatchWildcards=False

    EndWith

    Selection.Find.ExecuteReplace:

=wdReplaceAll

   

    WithSelection.ParagraphFormat

        .LeftIndent=CentimetersToPoints(0)        '左缩进0字符

        .RightIndent=CentimetersToPoints(0)       '右缩进0字符

        .FirstLineIndent=CentimetersToPoints(0)   '首行缩进点0公分

        .CharacterUnitLeftIndent=0                   '左缩进单位0字符

        .CharacterUnitRightIndent =0                  '右缩进单位0字符

        .CharacterUnitFirstLineIndent=0

    EndWith

   

    WithSelection.ParagraphFormat

        .LeftIndent=CentimetersToPoints(0)        '

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1