![]() |
|
|
|
#1
|
||||
|
||||
|
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 Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
||||
|
||||
|
Quote:
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 |
|
#3
|
||||
|
||||
|
Hello, Andrew,
I don't want to leave you with the impression, it worked all the time, cause in one case, it didn't. Didn't even flintch. So I want to let the readers here read it's not a 100% working script in those circumstances. Besides, does it exist and 100% full proof script? Or it's normal, it might not work all the time? I guess it depends if one variable is different than the test I've done previously. Quote:
I rather have a backup plan, than just one. Especially when time is an issue. Regardless, I love then help I get from this forum. I learn so much from people here ![]() Until next time. Cendrinne |
|
| Tags |
| help end of sentence, long paragraphs |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to change the line spacing between just 2 lines within a paragraph
|
Swarup | Word | 4 | 06-26-2019 02:32 PM |
| How to get rid of horizontal lines after each paragraph? | Nisus | Word | 10 | 10-08-2018 01:15 PM |
| double spaced within paragraph 2 blank lines between paragraphs | BigOldArt | Word | 1 | 08-24-2017 09:08 AM |
Lines refuse to merge into one paragraph (Word 2010)
|
Chris24 | Word | 2 | 01-22-2017 03:00 PM |
Keep Paragraph Lines Together Issue
|
SQLUSA | Word | 2 | 06-23-2012 05:00 PM |