View Single Post
Old 11-29-2006, 07:03 AM   #14
Stingo
Evangelist
Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.Stingo ought to be getting tired of karma fortunes by now.
 
Stingo's Avatar
 
Posts: 450
Karma: 1009553
Join Date: Nov 2006
Location: Miami
Device: KPW, KT, K3, KDXG, KDX, prs505(silver) and prs500(my first e-reader)
Good addition SVR. Rwood, you may still not want to put it at the end of my macro since there may be cases where it destroys formatting that you want to preserve. Julio Cortazar's E-book Rayuela is one example where this is the case.

It occurred to me that we need to play the switch game again if we are going to preserve two spaces after the period so you would want to do the following.

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ". "
.Replacement.Text = "#!#"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With

With Selection.Find
.Text = "([ ]{2,6})"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "#!#"
.Replacement.Text = ". "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Stingo is offline   Reply With Quote