Search code examples
ms-wordcopy-pasteformatting

microsoft word: copy without formatting


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)


Solution

  • 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