From: Tith on
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!
From: macropod on
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

--
Cheers
macropod
[Microsoft MVP - Word]


"Tith" <Tith(a)discussions.microsoft.com> wrote in message news:8E596209-EF2E-443B-BB29-8D9C6AE0A70D(a)microsoft.com...
>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!