Paste Special Macro

W

W M

Windows XP
Office XP

I am trying to make a button for a macro on my toolbar. Here is my problem.
When I record the macro, I am using the "paste special" command and choosing
unformatted text as my option. However, the macro, when played does not
"hold" this unformatted option. It will perform the "paste special" command,
but uses the default option which is "HTML Format". Can I modify my VBA code
to ensure my paste special option is unformatted text. Am I recording it
wrong perhaps? Any help you can provide is earnestly appreciated.
 
J

Jay Freedman

W said:
Windows XP
Office XP

I am trying to make a button for a macro on my toolbar. Here is my
problem. When I record the macro, I am using the "paste special"
command and choosing unformatted text as my option. However, the
macro, when played does not "hold" this unformatted option. It will
perform the "paste special" command, but uses the default option
which is "HTML Format". Can I modify my VBA code to ensure my paste
special option is unformatted text. Am I recording it wrong perhaps?
Any help you can provide is earnestly appreciated.

The recorder routinely makes mistakes when you record dialogs in which you
need to select from a list of options. Don't use it for those situations.

In this case, the (wrong) recorded statement is

Selection.PasteAndFormat (wdPasteDefault)

The correct statement, which can't be recorded, is

Selection.PasteSpecial datatype:=wdPasteText
 
J

Jean-Guy Marcil

W M was telling us:
W M nous racontait que :
Windows XP
Office XP

I am trying to make a button for a macro on my toolbar. Here is my
problem. When I record the macro, I am using the "paste special"
command and choosing unformatted text as my option. However, the
macro, when played does not "hold" this unformatted option. It will
perform the "paste special" command, but uses the default option
which is "HTML Format". Can I modify my VBA code to ensure my paste
special option is unformatted text. Am I recording it wrong perhaps?
Any help you can provide is earnestly appreciated.

Post your code... Maybe there is something else going on...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
W

W M

Thank you Jay, that worked brilliantly. And thank you for taking the time to
respond to my post.
 
P

Poseur

Windows XP
Office XP

I am trying to make a button for a macro on my toolbar.
Here is my problem. When I record the macro, I am using the
"paste special" command and choosing unformatted text as my
option. However, the macro, when played does not "hold"
this unformatted option. It will perform the "paste
special" command, but uses the default option which is
"HTML Format". Can I modify my VBA code to ensure my paste
special option is unformatted text. Am I recording it wrong
perhaps? Any help you can provide is earnestly appreciated.
Here's mine. Tied to a keyboard shortcut:
Sub PasteSpec()
Selection.PasteAndFormat (wdFormatPlainText)
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