Macro to count inline images

  • Thread starter Thread starter Tith
  • Start date Start date
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!
 
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
 
Back
Top