Why does the paste unformatted text function not work in macros?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my old version of Word (2000) I programmed a small macro that did "Paste
Special - Unformatted Text" - I assigned this to a button and used it
whenever pasting text into a document from another source (e.g. the Web). Now
I have Word 2003 and this same macro doesn't work. I can program it fine, but
then when I run it, the text gets pasted in with its own formatting.
 
Maybe you didn't program it as well as you thought? Try

Sub PasteUnfText()
On Error GoTo oops
Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
oops:
Beep
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Just by the way, I think we've seen reports before that there's a glitch in
the macro recorder relating to Paste Special Unformatted. Yet recording the
action via the Paste Options button works fine.
 
Thank you very much for that tip - it worked perfectly! I think that this is
a bug in Word - I noticed that if you try to record this macro, it uses the
function Selection.PasteAndFormat rather than Selection.PasteSpecial.

I really appreciate the help - this had been driving me crazy for quite some
time.
 

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

Back
Top