none
Dedicated paste as text buton in Quick Access Toolbar RRS feed

  • Question

  • I can add the Paste Special button to my Quick Access Toolbar but it still opens up a window where I have to then select Unformatted Text. Is there a button that only pastes as Unformatted Text so I don't have to always select it?

    Thanks, Peter

    Office Professional Plus 2010

    Friday, February 12, 2016 9:35 PM

Answers

  • I found this and it works in an Outlook email:

    Sub Paste_Special_Unformatted()
        Dim objDoc As Word.Document
        Dim objSel As Word.Selection
        On Error Resume Next
        ' get a Word.Selection from the open Outlook item
        Set objDoc = Application.ActiveInspector.WordEditor
        Set objSel = objDoc.Windows(1).Selection
        ' now do what you want with the Selection
        objSel.PasteSpecial Link:=False, DataType:=wdPasteText
        Set objDoc = Nothing
        Set objSel = Nothing
    End Sub

    Tuesday, February 23, 2016 3:11 AM

All replies

  • Hi Peter,

    As far as I know, there is no way to add a command to the Quick Access Toolbar to call the paste the Unformatted Text directly.

    As a workaround, we can write a macro like below to paste only text and add the macro to the Quick Access Toolbar:

    Sub PasteText()
    
    Selection.PasteSpecial DataType:=wdPasteText
    
    End Sub
    

    Please let me know whether the macro works for you.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 15, 2016 2:21 AM
    Moderator
  • Hi Fei,

    Thanks for the macro. I created the macro and added it to the Quick Access Toolbar. I am getting the error message:

    Run-time error '424'.

    Object required

    Monday, February 22, 2016 7:57 PM
  • Hi Peter,

    What's the Office application are you using? The code works only for the Word document. And for the other kind of Office application, you cay try to record a macro to get the sample code the for the paste with unformatted text. For example, there is an sample code get from the record macros in Excel:

     ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:= _
            False
    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 23, 2016 2:01 AM
    Moderator
  • I found this and it works in an Outlook email:

    Sub Paste_Special_Unformatted()
        Dim objDoc As Word.Document
        Dim objSel As Word.Selection
        On Error Resume Next
        ' get a Word.Selection from the open Outlook item
        Set objDoc = Application.ActiveInspector.WordEditor
        Set objSel = objDoc.Windows(1).Selection
        ' now do what you want with the Selection
        objSel.PasteSpecial Link:=False, DataType:=wdPasteText
        Set objDoc = Nothing
        Set objSel = Nothing
    End Sub

    Tuesday, February 23, 2016 3:11 AM
  • Waaaaay more complicated than it should be. Office should be more integrated than to have to go through these gyrations.

    Wednesday, February 24, 2016 8:30 PM