2

After copying from ppt, you often get lines that look like this:

This is a line
and then another line
and then another
and so forth. New lines created 
via SHIFT-ENTER.

Where I need it to say:

This is a line and then another line and then another and so forth. New lines created via SHIFT-ENTER.

New lines created by just pressing ENTER should remain as new lines.

4

2 回答 2

2

Shift + Enter is nothing but ^l

This is how Shift + Enter looks like

enter image description here

So you can either replace it manually or use the below VBA Code.

Non VBA Way

  1. Press Ctrl+H to open the Replace dialog.
  2. In the "Find what" box, type ^l.
  3. In the "Replace with" box, type " " (Space without the quotes).
  4. Click Replace All.

VBA Way

Paste this in a module

Sub Sample()
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^l"
        .Replacement.Text = " "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchKashida = False
        .MatchDiacritics = False
        .MatchAlefHamza = False
        .MatchControl = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
于 2013-04-13T16:47:24.420 回答
0

This page on the PPT FAQ I maintain explains the characters that PPT uses for linebreaks vs paragraph endings. It varies somewhat across versions and shape types.

Paragraph endings and line breaks http://www.pptfaq.com/FAQ00992_Paragraph_endings_and_line_breaks.htm

于 2013-04-15T00:06:08.783 回答