Replace "Shift-Enter" line break with "Enter" in word document using Microsoft office API

For those looking in MS Word: use Control-H {Find & replace].

Find Special character: manual Line break (^l, lowercase L)

Replace with: Paragraph mark (^p)

Replace All will do the whole document.

Edit: changed to lowercase characters.


The ms-word office API provides a find function in the Range object, enabling to search and replace the strings.

The following code is to find the manual line breaks("^l") with the carriage return("^p").

Range r = oDoc.Content;
r.WholeStory();
r.Find.Execute("^l", ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, "^p", WdReplace.wdReplaceAll);

Then use SaveAs to convert the word document to HTML, it will properly place each lines in <p> elements.