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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top