Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

Paste Special Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
W M - 20 Jan 2005 16:08 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.