Find a picture in a document

P

Patrick C. Simonds

I have inserted some pictures in a document and I need to be able to use a
macro to select the pictures individually. What I do not know is how to
determine the picture name in the document so that the macro can select the
picture.. The code would look like: ActiveDocument.Shapes("picture
4").Delete
 
M

macropod

Hi Patrick,

With pictures linked to the original image files, you can always use the image's filename.

With embedded pictures, however, unless you use vba to assign meaningful names to embedded pictures, you'll likely find yourself
trying to push a piece of string up a hill. That's because Word assigns the picture numbers according to the order in which they
were inserted into the document, irrespective of their relative locations. That and, if you delete one, the unused number doesn't
get reused. On the whole, therefore, you're likely to be better off working via the picture's location in the document. Even then,
if you've got more than one picture anchored to the same location, you'll be back to working with the insertion order unless you
start comparing page positions.

Cheers
 

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