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 / October 2005

Tip: Looking for answers? Try searching our database.

Macro for paste special

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BonzaiMaster - 20 Oct 2005 20:36 GMT
I've recorded a marco to do a 'Edit/Paste Special.../Unformatted Text" and
assigned it to a keyboard shortcut.

However it simply does a normal paste instead.

This is the recorded VBA:

Sub pastespecial()
'
' pastespecial Macro
' Macro recorded 20/10/2005
'
   Selection.PasteAndFormat (wdPasteDefault)
End Sub

Can anyone help please?
Jay Freedman - 20 Oct 2005 21:25 GMT
> I've recorded a marco to do a 'Edit/Paste Special.../Unformatted
> Text" and assigned it to a keyboard shortcut.
[quoted text clipped - 12 lines]
>
> Can anyone help please?

The macro recorder has many bugs, and this is one of them. Use this line
instead:

  Selection.PasteSpecial DataType:=wdPasteText

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org

BonzaiMaster - 20 Oct 2005 21:31 GMT
>   Selection.PasteSpecial DataType:=wdPasteText

That did it. Thanks very much.

Rate this thread:






 
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.