Picture, figure

V

vbaNOOB

Hi

Do word have object that store all pictures in active document?
Just like Hyperlinks or Bookmarks, paragraphs

How can I locate picture in the active document??

Many Thanks
 
J

Jay Freedman

There are two separate collections, ActiveDocument.Shapes and
ActiveDocument.InlineShapes. The first contains all 'floating' objects,
including pictures, things drawn with the tools on the Drawing toolbar,
WordArt objects, text boxes, and anything else you insert in the drawing
layer. The InlineShapes collection contains pictures and other objects that
are formatted as 'in line with text'. Each object in the collection has a
..Type property that will tell you what kind of thing it is.

In the general case, where your macro doesn't know anything in advance about
the document and what it contains, it can be very difficult to locate a
specific picture to work on. If you know more about the document, you can
sometimes solve the problem -- for example, if you know that the picture you
want is the only picture anchored within a certain paragraph, or if an
inline picture is inside a bookmark or a table cell. If the macro itself
inserts the picture, you can assign the return value of the .AddPicture
method to a variable (declared as the Shape data type) and use that variable
to modify the picture's properties.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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