Quote:
Originally Posted by Guessed
This appears to work but I would need to see a big data set to be confident in it
Code:
Sub NoBreaksForTheWicked()
Dim aRng As Range, iLine1 As Integer, iLine2 As Integer
Set aRng = ActiveDocument.Range
With aRng.Find
.Text = "(\(<*) "
.Replacement.Text = "\1^l"
.Forward = True
.MatchWildcards = True
.Wrap = wdFindStop
Do While .Execute
iLine1 = aRng.Information(wdFirstCharacterLineNumber)
aRng.Collapse Direction:=wdCollapseEnd
iLine2 = aRng.Words(1).Information(wdFirstCharacterLineNumber)
If iLine2 <> iLine1 Then
aRng.MoveStart Unit:=wdCharacter, Count:=-1
aRng.Text = Chr(160)
End If
aRng.Collapse Direction:=wdCollapseEnd
Loop
End With
End Sub
|
Andrew, I've tested on a small paragraph, and then tried on 5 pages worth of text with mixture of open parenthese with a word, in the middle of the paragraph and some at the end. Those in the middle, I've put the font color in Red, those at the end of the line, I've highlighted. So I can confirm, only those that were highlighted where affected.
So YES you can be confidant.
Thank you both of you, Guessed, and Macropod. You are both Great Mind Thinkers and Helpers.
I thank you from the bottom of my heart
Cendrinne