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.
Jay Freedman - 20 Jan 2005 17:18 GMT
> Windows XP
> Office XP
[quoted text clipped - 7 lines]
> 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

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
W M - 20 Jan 2005 17:27 GMT
Thank you Jay, that worked brilliantly. And thank you for taking the time to
respond to my post.
> > Windows XP
> > Office XP
[quoted text clipped - 18 lines]
>
> Selection.PasteSpecial datatype:=wdPasteText
Jean-Guy Marcil - 20 Jan 2005 17:22 GMT
W M was telling us:
W M nous racontait que :
> Windows XP
> Office XP
[quoted text clipped - 7 lines]
> 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...

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Poseur - 24 Jan 2005 03:16 GMT
> Windows XP
> Office XP
[quoted text clipped - 8 lines]
> 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

Signature
Poseur
"That's just kooky talk." --Kramer