• cut/copy and remove formatting/style (97 SR-2)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » cut/copy and remove formatting/style (97 SR-2)

    Author
    Topic
    #361971

    Lots of ideas on pasting unformatted text recently. My question- Is it possible to remove any local formatting and change the style to normal (or some other choice) when you cut or copy text from a word doc and send it to the clipboard? I’d like to be able to paste unformatted text into another application that doesn’t offer a paste unformatted option. Right now I am running the text through a third app or another doc along the way to turn it into plain text.

    Thanks, Dave

    Viewing 1 reply thread
    Author
    Replies
    • #548806

      Hi Dave:

      After you select the item to be cut:
      1. Press Ctrl+Spacebar to remove all direct character formatting.
      2. Press Ctrl+Q to remove all direct paragraph formatting.
      3. Press Ctrl+Shift+N to apply the normal style.

      Then you can cut & paste without applying additional styles or formatting to your target document. You could record this as a macro, if you do it often.

      Hope this helps.

    • #548922

      Dave,

      If you don’t mind messing around in the VB Editor, another option is to use a macro which will put the text in unformatted form, directly into the clipboard, using something called the DataObject.

      Andrew Cronnolly once posted a link to this page from Chip Pearson’s excellent website – I’ve adapted this code from his:

      Note: this requires that a reference be set in the code project to the Microsoft Forms 2.0 object library – a shortcut trick for doing this is to insert a userform into the code project, and then remove the userform – the reference to the forms library will remain.

      Public Sub PutUnformattedTextInClipboard()
      'Based on code by Chip Pearson
      'See: http://www.cpearson.com/excel/clipboar.htm
      'Note: requires a reference be set to
      'Microsoft Forms 2.0 object library
      Dim strText As String
      Dim MyDataObj As New DataObject
      
      strText = Selection.Range.Text
      MyDataObj.SetText strText
      MyDataObj.PutInClipboard
      
      Set MyDataObj = Nothing
      End Sub
      

      Also note that this code substitutes for the Copy command. If you also wanted to delete the selected text (as in Cut), you’d need to press Backspace or Delete, after running this macro. It would be possible to have two macros like this, one for unformatted copy and one for unformatted cut, but I’ve left it this way for simplicity’s sake.

      Gary

      • #549012

        Thanks Phil and Gary!

        Good thinking, looks like both these solutions will work for me. I figured there’d be a VBA way to do it, if I cant figure out the userform part, I’ll post back. Phil’s idea seems obvious now, but isn’t that always the case with hindsight? I’ll try them both out.

        Kudos, Dave Parker

    Viewing 1 reply thread
    Reply To: cut/copy and remove formatting/style (97 SR-2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: