problem creating a Word paste special macro

M

mcloo

I am using Word 2003 on an XP operating system. I created a new macro I
called "PasteSpecial." To create the macro, I went to Tools > Macro > Record
New Macro. I named the macro "PasteSpecial" and clicked the Keyboard icon to
create a keyboard shortcut. I assigned Alt+V as the keyboard shortcut and
clicked Assign and then Closed.

The macro began recording. Before creating the macro I copied a couple of
lines of text that I wanted to paste in my document. I then placed my cursor
at the spot at which I planned to paste the text. After the macro began
recording, I clicked Edit > Paste Special > Unformatted Text. The text was
pasted and was formatted according to the style of the paragraph into which I
pasted it; not its original style.

I then clicked the stop button on the macro toolbar.

Since this process worked while I was recording the macro, I assumed that it
would work when I clicked Alt+V. However, when I attempted to use the macro
to paste text as unformatted text, the Alt+V action worked in that the text
was pasted; however, it pasted using its original format, not as unformatted
text.

I used this same process to create this same macro in other versions of Word
and did not have a problem. Why am I having a problem now, and what can I do
to make this thing work?
 
G

garfield-n-odie [MVP]

Yeah, it's a known bug that the macro recorder doesn't quite correctly
record the paste as unformatted text command. Use this macro instead:

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

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