I would approach that in a different way which the following macro does. It
does throw up an error message that you can just ignore. (While I know what
is causing the error, I haven't devised a method to prevent the it from
occuring)
Dim i As Long, j As Long, k As Long
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "( [0-9]{1,}.)"
.Replacement.Text = "^p\1"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
i = ActiveDocument.Paragraphs.Count
j = 1
With ActiveDocument
.Paragraphs.First.Range.Characters.Last.Delete
Do While i > 0
Do While .Paragraphs(j).Range.Characters.Count + .Paragraphs(j +
1).Range.Characters.Count < 250
.Paragraphs(j).Range.Characters.Last.Delete
i = i - 1
Loop
j = j + 1
.Paragraphs(j).Range.Characters.First.Delete
Loop
End With

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I would approach that in a different way which the following macro does. It
>does throw up an error message that you can just ignore. (While I know what
[quoted text clipped - 31 lines]
> Loop
>End With
Hi Doug
Thanks very much for that - what a difference a digit makes!
I couldn't get it to run , I'm afraid , with a syntax error given in
this line :
Do While .Paragraphs(j).Range.Characters.Count + .Paragraphs(j +
1).Range.Characters.Count < 250
it wouldn't run beyond this unfortunately.
I did wonder if it was a pasting error between this mail program and the
VBA screen in Word , and removed a character before the '1' in j + 1.
This ran but did give an error as you said , but also seemed to put a
return before every number.
This caused a list down the page starting with each track number -
clearly not the intention. When I cleared the error popup , the text was
returned to original format. Maybe there's another pasting glitch.
Would using the Number Full Stop as a cue be easier VBA-wise than using
Space Number , I wonder?
Best Wishes
Colin
Doug Robbins - Word MVP - 30 Dec 2006 10:19 GMT
The mail program has introduced a line break that splits that command
causing the problem
The command
Do While .Paragraphs(j).Range.Characters.Count + .Paragraphs(j +
1).Range.Characters.Count < 250
should all be on one line or have Visual Basic line break character inserted
in it as
Do While .Paragraphs(j).Range.Characters.Count + .Paragraphs(j + _
1).Range.Characters.Count < 250

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>>I would approach that in a different way which the following macro does.
>>It
[quoted text clipped - 61 lines]
>
> Colin
Colin Hayes - 30 Dec 2006 21:28 GMT
>The mail program has introduced a line break that splits that command
>causing the problem
[quoted text clipped - 9 lines]
> Do While .Paragraphs(j).Range.Characters.Count + .Paragraphs(j + _
>1).Range.Characters.Count < 250
Hi Doug
OK Thanks for that - I'm grateful for you help. I got it to run , and it
works
fine. It does give an error , as you say , but it does the job. Thanks.
BTW Would it be easy to adapt the code below to split a passage at it's
half-way mark?
Dim srange As Range
Set srange = ActiveDocument.Range
srange.End = srange.Start + 249
Do While srange.End < ActiveDocument.Range.End
Do While srange.Characters.Last <> " "
srange.End = srange.End - 1
Loop
srange.InsertAfter vbCr & vbCr
srange.Start = srange.End + 2
srange.End = srange.Start + 249
Loop
Best Wishes
Colin
Doug Robbins - Word MVP - 30 Dec 2006 21:37 GMT
Change the 249 to 224

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>>The mail program has introduced a line break that splits that command
>>causing the problem
[quoted text clipped - 35 lines]
>
> Colin
Colin Hayes - 30 Dec 2006 22:48 GMT
>Change the 249 to 224
Hi Doug
Sorry I think I can't have explained correctly.
I meant could the code below be amended to split at the mid-point of any
passage of any length. Sorry if I wasn't clear.
Dim srange As Range
Set srange = ActiveDocument.Range
srange.End = srange.Start + 249
Do While srange.End < ActiveDocument.Range.End
Do While srange.Characters.Last <> " "
srange.End = srange.End - 1
Loop
srange.InsertAfter vbCr & vbCr
srange.Start = srange.End + 2
srange.End = srange.Start + 249
Loop
Best Wishes
Colin
Doug Robbins - Word MVP - 31 Dec 2006 07:06 GMT
Use
Dim srange As Range
Set srange = ActiveDocument.Range
srange.End = srange.Start + srange.Characters.Count / 2
Do While srange.Characters.Last <> " "
srange.End = srange.End - 1
Loop
srange.InsertAfter vbCr

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>>Change the 249 to 224
>
[quoted text clipped - 20 lines]
>
> Colin
Colin Hayes - 31 Dec 2006 19:04 GMT
>Use
>
[quoted text clipped - 5 lines]
>Loop
>srange.InsertAfter vbCr
Hi Doug
OK that works a treat - thanks for all your help. Much appreciated.
Best Wishes
Colin
Shauna Kelly - 30 Dec 2006 10:20 GMT
Hi Colin
This code
Do While .Paragraphs(j).Range.Characters.Count + .Paragraphs(j +
1).Range.Characters.Count < 250
should all be on one line. The newsgroup post probably broke it
inappropriately.
If you adjust the code and it's no longer red, then you'll know you've
eliminated the syntax error. Then try to run the code again.
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
>>I would approach that in a different way which the following macro does.
>>It
[quoted text clipped - 61 lines]
>
> Colin