确保句子之间有两个空格的宏 [英] Macro for ensuring two spaces between sentences

查看:72
本文介绍了确保句子之间有两个空格的宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人为我创建了这个宏,以确保句号和新句子之间只有一个空格。  

Someone kindly created this macro for me for ensuring only one space between a full stop and a new sentence.  

例如完全停止。新句子。 

e.g. Full stop. New sentence. 

我现在需要创建一个宏来确保句号和新句子之间有两个空格。  

I now need to create a macro for ensuring there are two spaces in between a full stop and a new sentence. 

例如完全停止。 新句子。 

e.g. Full stop.  New sentence. 

这是一个空格的宏: 

This is the macro for one space: 

Sub ReduceSpaces()

Sub ReduceSpaces()

    Application.ScreenUpdating = False

    Application.ScreenUpdating = False

    使用ActiveDocument.Content.Find

    With ActiveDocument.Content.Find

        .ClearFormatting

        .ClearFormatting

        .Text =" {2,}"

        .Text = " {2,}"

        .Replacement.ClearFormatting

        .Replacement.ClearFormatting

        .Replacement.Text =" "

        .Replacement.Text = " "

        .MatchCase = False

        .MatchCase = False

        .MatchWholeWord = False

        .MatchWholeWord = False

        .MatchWildcards = True

        .MatchWildcards = True

        。执行替换:= wdReplaceAll

        .Execute Replace:=wdReplaceAll

    结束

    Application.ScreenUpdating = True

    Application.ScreenUpdating = True

End Sub

我只是不确定哪个点修改使它有两个空格。 有人可以帮忙吗?

I am just not sure which bit to amend to make it so there are two spaces.  Can someone help? 

推荐答案

这是一个宏:

Sub AddSpaces()
    Application.ScreenUpdating = False
    With ActiveDocument.Content.Find
        .ClearFormatting
        .Text = ". ([! ])"
        .Replacement.ClearFormatting
        .Replacement.Text = ".  \1"
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
    End With
    Application.ScreenUpdating = True
End Sub


这篇关于确保句子之间有两个空格的宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆