Macro to count inline images

T

Tith

I have to format about 10000 word docs that are generated from another source
for a test report. I have built a a macro to do the formating for me but I
would rather make it more automated. I have two differnt reports, the only
difference between them is the number of inline objects.

1. How do I count the number of inline objects?
2. How do I automate word to run the module on a directory (including
sub-directories)
3. How to Save-as in order to maintain the originals?

Thank you!
 
M

macropod

Hi Tith,

For a given document, you can use a macro like:
Sub InlineShapeCount()
Dim i As Integer, oRng As Range
With ActiveDocument
For Each oRng In .StoryRanges
i = i + oRng.InlineShapes.Count
Next
End With
MsgBox "This document has " & i & " Inline Shapes."
End Sub
 

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