Pasting with Macro does not work

K

Krohn

I created a simple macro to paste UNFORMATTED text. But Word actually pastes
the text fully formatted. I can manually paste unformatted text, but Word
will not allow me to perform this function using shortcuts.
 
S

Stefan Blom

Since you haven't posted the code you are using, it's impossible to
tell what is wrong with it. The following should work, though:

Sub PasteAsUnformatted()
On Error Resume Next
Selection.PasteSpecial DataType:=wdPasteText
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
J

JimH44

Stefan Blom said:
Since you haven't posted the code you are using, it's impossible to
tell what is wrong with it. The following should work, though:

Sub PasteAsUnformatted()
On Error Resume Next
Selection.PasteSpecial DataType:=wdPasteText
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
This code works nicely in Word 97 to 2003, but breaks in Word 2007.
But if you step through the macro, you'll find it working.
This bug has been noticed already, and you can read about it a
http://www.experts-exchange.com/Sof.../Office_Suites/MS_Office/Word/Q_22112491.html

I have emailed (e-mail address removed) in the hope that MS will fix it.

In the mean time, I developed a workaround that works in my particular
situation, but it would be great if it could be fixed.

Jim
 

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