Extracting all Tables and Images from document in order

S

Steve Jeter

I have a document with both Tables and Images throughout and I want to start at beginning of the document and extract the tables and images in order, pasting into a separate document. I know how to do a for loop for just all tables or all images but how do I code for selecting both?

Thank you for any reply.
 
J

Jay Freedman

I have a document with both Tables and Images throughout and I want to start at beginning of the document and extract the tables and images in order, pasting into a separate document. I know how to do a for loop for just all tables or all images but how do I code for selecting both?

Thank you for any reply.

I don't think that's possible in a general case. If all the images have a text
wrapping of In Line With Text and each is the only thing in its paragraph, you
could loop through the Paragraphs collection and examine the content of each
paragraph's Range. Dealing with floating images (and floating tables, which
are also possible) would be extremely difficult.

A more reasonable approach is to start by making a copy of the original
document. Then delete everything in the copy that isn't a table or an image
(Shape or InlineShape).
 

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