Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Deleting All Objects (word 2003)

    While copying and pasting information from websites into a Word document, I have ended up with a lot of "stuff" in the document; When all I really wanted was the text. I could then, later, apply any formatting that I wanted.

    I have found that using Ctrl+A and then Ctrl+Shift+F9 will delete all hyperlinks.

    In a similar fashion, is there a quick way to delete all the other objects? I think it's mostly small pictures. I can click on them and hit delete and they go away instantly but with hundreds of such objects, there must be a quicker way?

    I think next time I need to do this, I'll copy to Notepad first and then to Word. That would probably filter out everything but the text. But Notepad does have some size limitations...
    - Ricky

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Deleting All Objects (word 2003)

    Hi Ricky,

    I think you'll need code for this. Something like:

    Sub DelShapes()
    For Each ShapeRange In ActiveDocument.Shapes
    ShapeRange.Delete
    Next
    End Sub

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting All Objects (word 2003)

    Thanks for helping.

    I have placed the code into a module (Normal) and attached it to a toolbar button. For some reason [most likely, my fault], it will not delete the objects from a test document that I've created.

    I've inserted several clip art images and running the macro doesn't seem to do anything. I've tried clicking the newly created toolbar button and going the route of Tools|Macro|Macros...|DelShapes|Run. Neither method will remove the clipart images.

    Also, running the code doesn't create any error messages. Any thoughts?
    - Ricky

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Deleting All Objects (word 2003)

    Hi Ricky,

    I forgot about inline shapes. The following should take care of them too:

    Sub DelShapes()
    For Each ShapeRange In ActiveDocument.Shapes
    ShapeRange.Delete
    Next
    For Each InlineShape In ActiveDocument.InlineShapes
    InlineShape.Delete
    Next
    End Sub

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Deleting All Objects (word 2003)

    If all you want is the text and don't even want any table formatting (as per your Notepad option) then the quickest way is to choose to Edit > Paste Special > Text Only. This is fastest when you first hit Word with your clipboard full of web page but you can also do this once you have already pasted into your doc if you
    Ctrl-A, Ctrl-X and then choose Paste Special
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting All Objects (word 2003)

    Hey Pod, Thanks for the code. It is much appreciated. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

    Also, thanks Andrew. Sometimes, the common-sense approach is the way to go. I'm pretty good at making things more complicated than they need to be... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    - Ricky

  7. #7
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting All Objects (word 2003)

    I do a lot of text-only pasting. So I created a little macro that basically does the same thing as described by Andrew, and attached the keyboard combination Alt+V to it, saving me the trouble of going through the menu each time:

    Public Sub PastePlainText()
    If Documents.Count > 0 Then 'To prevent error if no doc loaded
    Selection.PasteSpecial DataType:=wdPasteText
    End If
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •