How do I delete Word Picture with macro

B

BrianG

I've created a three page sheet with the company logo, pasted as a Word
picture) on the top of each one. There are occasions when only one or
two sheets require data so I'm using the Auto_Close macro to delete the
unused pages. The problem is that I cannot get the Word pictures to
delete. The resulting saved file always has the Word picture image(s)
from the deleted pages(s) at the bottom. How can I delete these along
with the pages?

BrianG



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Tom Ogilvy

anything like this is a shape. You have to delete the shape.

i = 0
for each shp in Activesheet.shapes
i = i + 1
if i > 1 then
msgbox shp.name
shp.select
' shp.delete
End if
Next

if you know there names you could just do

Activesheet.shapes("Picture 2").Delete

Activesheet.shapes("Picture 3").Delete

as an example.
 

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