Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-18-2011, 07:40 AM
croy croy is offline paste special default Windows 7 paste special default Office 2007
Novice
paste special default
 
Join Date: Nov 2010
Posts: 1
croy is on a distinguished road
Default paste special default


I've tried to build a macro for paste-special-unformatted. It works as expected when I'm recording the macro, but when I run the macro later, it pastes-formatted. When I view the macro, it says that formatted is the paste special default, so I'm guessing I need to change the default to get the macro to function the way I want. Any suggestions?
Reply With Quote
  #2  
Old 03-18-2011, 11:54 AM
Ulodesk Ulodesk is offline paste special default Windows 7 32bit paste special default Office 2007
Word 2013 Expert Cert
 
Join Date: Sep 2009
Location: Virginia
Posts: 786
Ulodesk is on a distinguished road
Default Unformatted

Hi, Croy. Word's recorder simply won't do it; I don't know enough to know why. In any case, the one below works; it's what I use daily.

If you're unfamiliar with the VBA editor, press Alt+F11 to open it. Double-click on the New Macros module in the Macros module on the left, and find the macro you named and recorded in the right-hand text pane. If will begin with Sub and the name you gave, and end with End Sub. Replace that with this, or edit it to match this.

Best,
Ulodesk


Sub PasteUnformatted()
'
' PasteUnformatted Macro
'
Selection.PasteSpecial Link:=False, DataType:=wdPasteText
End Sub
Reply With Quote
  #3  
Old 03-20-2011, 04:29 AM
macropod's Avatar
macropod macropod is offline paste special default Windows 7 32bit paste special default Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,466
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

My preference is for:
Code:
Sub PasteUnformattedText()
' The next line is in case there's nothing in the Clipboard
On Error Resume Next
Selection.PasteSpecial DataType:=wdPasteText
End Sub
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
paste special default Paste Special Unformatted Text kenwpaul Office 2 02-25-2011 04:53 PM
Paste Special Link no longer working MrsMoe PowerPoint 0 12-20-2010 10:54 PM
paste special default special copy/paste iconofsin Excel 1 09-15-2010 12:10 AM
Using Paste/Special wih Excel data chickasaw PowerPoint 0 02-05-2010 10:00 PM
paste special default Copy and paste special Dace Excel 2 02-16-2009 12:18 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 03:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft