Paste from web leaves yellow "script" images - how to remove

K

kevin.bourque

I'm writing a little sub which will take pages/content which I copy
from the web and paste into Word and clean it up a bit. I occasionally
will see small, yellow images with a script or scroll picture in the
Word document; I believe these are places where the original webpage
had some javascript.

I want to remove these since I don't need them, but am having trouble
finding them in the DOM (i.e. I don't know what the heck they are!)
I've tried InlineShape, Object, Shape, etc... but to no avail. Does
anyone have any experience in removing these or know how I can describe
them?

This is what I have but it doesn't work... it will stop on the "Is
Nothing" when certain InlineShapes are active.

--------------

Sub getScriptIcons()

Dim ishp As InlineShape

For Each ishp In ActiveDocument.InlineShapes
If Not ishp.Script Is Nothing Then
ishp.Delete
End If

Next ishp

End Sub
 
P

Perry

Replace
If Not ishp.Script Is Nothing Then
By
If Not ishp Is Nothing Then

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top