View Single Post
 
Old 06-17-2020, 12:40 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

For a start you are not differentiating between shapes and inline shapes and you need to check all the story ranges where there are shapes e.g. as follows. Note that some of the parameters you want to list are not applicable to inline shapes.



Code:
Sub CheckShapes()
Dim oStory As Range
Dim oShape As Shape
Dim oiShape As InlineShape

    For Each oStory In ActiveDocument.StoryRanges
        For Each oShape In oStory.ShapeRange
Debug.Print oShape.Type & "; " & oShape.ID & "; " & oShape.Name
        Next oShape
        For Each oiShape In oStory.InlineShapes
Debug.Print oiShape.Type
        Next oiShape
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                For Each oShape In oStory.ShapeRange
Debug.Print oShape.Type & "; " & oShape.ID & "; " & oShape.Name
                Next oShape
                For Each oiShape In oStory.InlineShapes
Debug.Print oiShape.Type
                Next oiShape
            Wend
        End If
    Next oStory
    Set oStory = Nothing
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote