Question

When I copy a text from Microsoft Word and the text is a heading in the clipboard I see it included a paragraph number. Then in another application I must remove the number manually. Can I copy just a text without any additional information? (The same is with Chrome when you copy a URL it adds a http:// automatically)

Was it helpful?

Solution 2

Try this

Sub FormatFreeTextCopy()
    Dim ffText As DataObject
    Set ffText = New DataObject
    ffText.setText Selection.Text
    ffText.PutInClipboard
End Sub

Note: You would have to Reference to Microsoft Forms Object Library

OTHER TIPS

Method 1:-

one way is right mouse click and use this paste special option

enter image description here

Method 2:- assign a shortcut(Ctrl+Shift+V) for this operation (Note: by default Ms word not set shortcut for it so we need to set it by own)

  • File > Options > Customize Ribbon > Keyboard shortcuts: Customize.
  • on Left Categories List section, click on All Commands
  • Under right Commands List, select for PasteTextOnly
  • then Set the keyboard shortcut for PasteTextOnly as Ctrl+Shift+V

enter image description here

Method 3 permanent/Default Settings

use this option which will each time paste as plain text by default

enter image description here

There is a generic "paste plain text" solution using autohotkey open-source automation software:

^+v::                            ; Text–only paste from ClipBoard
   Clip0 = %ClipBoardAll%
   ClipBoard = %ClipBoard%       ; Convert to text
   Send ^v                       ; For best compatibility: SendPlay
   Sleep 50                      ; Don't change clipboard while it is pasted! (Sleep > 0)
   ClipBoard = %Clip0%           ; Restore original ClipBoard
   VarSetCapacity(Clip0, 0)      ; Free memory
Return
  1. Save this code to paste_plain_text.ahk script
  2. Install autohotkey
  3. Execute your script

It will paste plain text using Ctrl+Shift+V shortcut. You can put your script at Startup directory so it loads on Windows startup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top