Paste unformatted text without paragraph marks

A

astridc

Hi!

Is there any code to paste unformatted text and at the same time elliminate
the paragraph marks/brakes? Thanks!
 
H

Helmut Weber

hi astridc,

maybe that will help you:

Sub Macro3()
Dim Clp As DataObject
Dim str As String
Set Clp = New DataObject
Clp.GetFromClipboard
str = Clp.GetText(1)
str = Replace(str, vbCrLf, " ")
selection.TypeText str
End Sub

It needs a reference to the
Microsoft Forms 2.0 Object Library.

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
Top