Paragraph every other word

  • Thread starter Thread starter Yarroll
  • Start date Start date
Y

Yarroll

Hello,

How do I insert a paragraph mark every other word?

For example, I want to transform a sentence like

My cat is lazy

into:

My cat
is lazy

Sorry for such a stupid question :-(( Thanks.
Yarroll
 
Use

Dim myrange As Range
Set myrange = Selection.Paragraphs(1).Range
While myrange.Paragraphs.Count < myrange.Words.Count / 2
If myrange.Paragraphs.Last.Range.Words.Count > 2 Then
myrange.Paragraphs.Last.Range.Words(2).InsertAfter vbCr
Else
Exit Sub
End If
Wend


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
Back
Top