12 Nov 2004
Make “Paste Unformatted Text” the default in Microsoft Word
Make “Paste Unformatted Text” the default in Microsoft Word: This has been bugging the shit of me for years and I finally thought of Googling it today.
Make “Paste Unformatted Text” the default in Microsoft Word: This has been bugging the shit of me for years and I finally thought of Googling it today.
The only problem I’ve found with this is that it prevents you from being able to paste graphics with Ctrl-V (but still works when you hit the paste button or select paste from the menu).
Matt | 15 Nov 2004Yeah, I discovered the same thing. But since I paste text more than I ever paste pictures, it works perfectly for me.
David July | 29 Nov 2004This should solve the bitmap issue:
Const CF_TEXT = &H1
Private Declare Function IsClipboardFormatAvailable _
Lib “user32” (ByVal uFormat As Long) As Long
Sub PasteUnformattedText()
If IsClipboardFormatAvailable(CF_TEXT) Then
Selection.PasteSpecial Datatype:=wdPasteText
Else
Selection.Paste
End If
End Sub
The bitmap check of the clipboard does not work. There is probably other code that has not been included.
Can Darko please provide an update to allow the modified macro to work. The idea is good but I can’t make it run.
David | 14 Mar 2006The bitmap check of the clipboard does work if in the General Declarations the following is inserted:
Const CF_TEXT = &H1
Private Declare Function IsClipboardFormatAvailable _
Lib “user32” (ByVal uFormat As Long) As Long
And then a macro is made titled PasteUnformattedText and containing:
Sub PasteUnformattedText()
If IsClipboardFormatAvailable(CF_TEXT) Then
Selection.PasteSpecial Datatype:=wdPasteText
Else
Selection.Paste
End If
End Sub
the trick is to split it into the relevant visual basic sections. Works just fine. I assigned mine to a keyboard command Alt-V and pasting text only is now a breeze.
David | 19 Jun 2006Thanks. This has been bugging me for years too! I never thought of using a macro…
Another David | 28 Apr 2009
Thank you for this great tip!
David July | 15 Nov 2004