Macro - Paste Unformated Text

  • Thread starter Thread starter GR
  • Start date Start date
G

GR

How do I create a macro to "Paste Unformatted Text" in Word 2002? I note
keystroke recording does not work for this command, just as in WordPerfect.
GR
 
Hi GR-

If recording, you can;

1) Use the mouse to select the command in the menu, or
2) use the keystroke series Alt+e,s,{arrow to command},Enter

Both generate the same code:

Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False

HTH |:>)
 
I guess I am near brain-dead. Clearly, I am doing something very wrong
because I get: Selection.PasteAndFormat (wdPasteDefault)

My steps using the mouse are: (1) Select Edit/Paste Special, and (2) from
the resulting menu, select "Unformatted Text" and click "OK." Where am I
going wrong?

What about my copying and pasting the command you quote below into my macro?
GR
 
You should be fine to paste in CyberTaz's code. See here for more detailed
instructions:
What do I do with macros sent to me by other newsgroup readers to help me
out?
I don't know how to install them and put them to use
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

You could also try recording the macro by copying, pasting, then setting the
paste options clipboard icon to "keep text only." I'd be curious to know
whether that works. Even though it should be the same thing, MacWord 2004
has a bug where the Paste Special route generates the wrong code, but the
Paste Options icon generates the right code. Suddenly I bet this bug was
imported from Word 2002.
 
Hi Daiya and GR,

You're right, recording the Paste Special dialog gives wrong code
while recording the use of the Paste Option button does work correctly
in WinWord. Here are the results:

Sub Macro1()
'
' Macro recorded from Edit > Paste Special
' (doesn't work -- gives source format)
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

Sub Macro2()
'
' Macro recorded from using Paste Option button
' (works correctly)
'
Selection.PasteAndFormat (wdFormatPlainText)
End Sub

Sub Macro3()
'
' Macro written from scratch
' (works correctly)
'
Selection.PasteSpecial DataType:=wdPasteText
End Sub
 
Back
Top