Removing "script" images from document after pasting

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. Below
you'll find the closest I've come, using the InlineShape.Script object.

Does anyone have any experience in removing these or know how I can
describe
them?

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

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
 
T

Tony Jollans

Could you just mean the Word Paste Options button? If so, it's nothing to do
with what you are actually pasting, nor is it an object in the document.
You can switch it off under Tools > Options > Edit tab
 

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