I have a large Word docx file with text and many pictures. I would like to apply a border/frame style to all pictures at once. I do not want to do that individually for all pictures.

So I believe a macro is the way to go, but am not very fluent in creating Word macros. I think this is the start, but get an error about trying to apply the settings to a `<hr>` element. 

Here's the macro code I used. I suspect just a small tweak will fix it (allowing the code to run against all picture objects) is needed.

```
Sub addborder()
'
' addborder Macro
'
'
Dim i As Long, j As Long
With ActiveDocument.Range
    For i = 1 To .InlineShapes.Count
        With .InlineShapes(i)
            For j = 1 To .Borders.Count
                .Borders(j).LineStyle = wdLineStyleSingle
                .Borders(j).Color = wdColorAutomatic
            Next j
        End With
    Next i
End With
End Sub

```

Thanks.

---

**Added:**

Note that the document has some `<hr>` inside, and that element is stopping the macro (can't apply those parameters to the `<hr>` element). So the macro has to select only picture images.