My goal is to:
- Copy text in a PDF to the clipboard
- In a single move, paste the text to MS Word while
- Replacing all line breaks with a space
- Matching the destination's formatting
I created a macro which replaces all line breaks with spaces in a document.
Selection.Find.Execute Replace:=wdReplaceAll
Selection.WholeStory
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
How to apply the replacement to the clipboard and then paste this replaced snippet?
^pinto" "in clipboard and than paste it to Word. You already managed to do it in document after pasting... Is there something wrong with replacement in Word document? Sorry, please help me to understand. - Kazimierz Jawor