Re: Create a new line after every sentence



I am not so sure about this.

The OP originally writes:

"Currently I have 4 or 5 pages of sentences that are not on a single line per
sentence as well there are carriage returns throughout."

Yet also writes:

"Notice how every sentence is set on a new line there are no carriage returns
within each sentence."

On one hand there are carriage returns throughout, on the other there are no
carriage returns.

From looking at the example text, it sure seems to me that the "lines" are
not terminated by a ^p (paragraph mark), but by a ^l (manual line break)

Further, regarding one v.s. two spaces between sentences, this can easily be
handled by using Sentences itself.

I agree that using Find & Replace is likely faster, but here is a possible
alternative.

Sub Sentence2Paragraph()
Dim j As Long
' replace all manual line breaks with nothing
ActiveDocument.Content = _
Replace(ActiveDocument.Content, Chr(11), "")

' add a paragraph mark to each sentence, thus
' making it a paragraph
For j = 1 To ActiveDocument.Sentences.Count - 1
ActiveDocument.Sentences(j).Text = _
ActiveDocument.Sentences(j).Text & vbCrLf
Next
End Sub

This deals with Sentences, so it does not matter if there is one, or two, or
five spaces between them.
David Horowitz wrote:
Best of luck!

Excellent Guys,

[quoted text clipped - 88 lines]

Cheers,

--
Message posted via http://www.officekb.com

.



Relevant Pages

  • RE: Excel to text file
    ... "Joel" wrote: ... the data while print doesn't both have the same syntax. ... Print will add the carriage return and ... Sub PrintAttachments() ...
    (microsoft.public.excel.programming)
  • Re: Input box and carriage return for chart title
    ... I don't believe there is a way to force a carriage return ... you can put one in after the entry is complete. ... Sub SplitInputBoxText() ... Dim lngDot As Long ...
    (microsoft.public.excel.programming)
  • RE: Split data around a carriage return
    ... Sub Testing123 ... Dim strSep As String ... 'Chror vbCr is the carriage return ... 'see "Miscellaneous Constants" in VBE Help for more options ...
    (microsoft.public.excel.programming)
  • Re: Removing carriage returns from excel
    ... Sub Remove_CR_LF ... Gord Dibben MS Excel MVP ... addresses and some other fields are being exported with the carriage return, ... Please can someone please tell me how to formute the cell as 123 Street Unit ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Removing hyphens
    ... Remove all the hyphens at the end of the line. ... remove the carriage returns at the end of each line of a paragraph. ... for the second time today I have carelessly pasted stuff ... > Sub One_Paragraph ...
    (microsoft.public.mac.office.word)