Discussion:
Simple macro for 'paste unformatted text' won't work
(too old to reply)
rodmac
2008-03-16 20:32:07 UTC
Permalink
Can anyone here help me with this weirdness? Just downloaded Word2007, and
do a ton of pasting as unformatted text. I really want this as a keyboard
shortcut, which I have relied on for years.

I can't find Paste Special: Unformatted Text on the All Commands list - it
was there in Word 2000, my last version - and it isn't in the default
macros.

When I try to record a simple macro using the mouse, the resulting macro
consistently pastes the source formatting, not unformatted text. If I just
use the interface, the paste unformatted text works fine.

The macro recorder won't record the sequence, and I get this:

Sub PasteAsText()
'
' PasteAsText Macro
'
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

If I knew what paste unformatted was I would just edit the macro, but I
haven't a clue about VBA or whatever this language is.

Any help appreciated.

Rod
macropod
2008-03-17 00:23:47 UTC
Permalink
Hi Rod,

Try:

Sub PasteUnformattedText()
' The next line is in case there's nothing in the Clipboard
On Error Resume Next
Selection.PasteSpecial DataType:=wdPasteText
End Sub

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------
Post by rodmac
Can anyone here help me with this weirdness? Just downloaded Word2007, and
do a ton of pasting as unformatted text. I really want this as a keyboard
shortcut, which I have relied on for years.
I can't find Paste Special: Unformatted Text on the All Commands list - it
was there in Word 2000, my last version - and it isn't in the default
macros.
When I try to record a simple macro using the mouse, the resulting macro
consistently pastes the source formatting, not unformatted text. If I just
use the interface, the paste unformatted text works fine.
Sub PasteAsText()
'
' PasteAsText Macro
'
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub
If I knew what paste unformatted was I would just edit the macro, but I
haven't a clue about VBA or whatever this language is.
Any help appreciated.
Rod
rodmac
2008-03-17 04:15:05 UTC
Permalink
Thanks a lot, macropod! Your macro did the trick and I'm back in fast
one-key text-pasting business.

R
Post by macropod
Hi Rod,
Sub PasteUnformattedText()
' The next line is in case there's nothing in the Clipboard
On Error Resume Next
Selection.PasteSpecial DataType:=wdPasteText
End Sub
Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------
Post by rodmac
Can anyone here help me with this weirdness? Just downloaded Word2007,
and do a ton of pasting as unformatted text. I really want this as a
keyboard shortcut, which I have relied on for years.
I can't find Paste Special: Unformatted Text on the All Commands list -
it was there in Word 2000, my last version - and it isn't in the default
macros.
When I try to record a simple macro using the mouse, the resulting macro
consistently pastes the source formatting, not unformatted text. If I
just use the interface, the paste unformatted text works fine.
Sub PasteAsText()
'
' PasteAsText Macro
'
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub
If I knew what paste unformatted was I would just edit the macro, but I
haven't a clue about VBA or whatever this language is.
Any help appreciated.
Rod
Loading...