How to use VBA to find in the document all the drawings for which the size is set to more than 100% relative to the original, and set it to 100% for such drawings?

Example

I tried to write a macro to understand how to do it, but the operation of setting the scale is not recorded :(

Attached is an example of a document with two pictures. The second drawing in it is just with a scale larger than 100%.

    1 answer 1

    Found a solution:

    For Each Shape In Doc.Shapes Dim Figure As Shape Set Figure = Shape ' Изображение содержит подпись? If Figure.Type = msoAutoShape And Figure.TextFrame.HasText Then With Figure.TextFrame.TextRange ' Количество абзацев равно 2? (изображение и подпись) If .Paragraphs.Count = 2 Then If .InlineShapes.Count = 1 Then Dim picture As InlineShape Set picture = .InlineShapes(1) ' Если масштаб картинки больше чем 100%, ставим его равным 100% If picture.ScaleWidth > 100 Then picture.ScaleWidth = 100 End If End If End If End With End If Next