Question

Is it possible to apply a style or at least give a thin border to all the images in a Word 2013 document using VBA?

Was it helpful?

Solution

The following should work,

Dim pic As InlineShape
For Each pic In ActiveDocument.InlineShapes
  pic.Borders.OutsideLineStyle = wdLineStyleSingle
  pic.Borders.OutsideLineWidth = wdLineWidth050pt
Next

OTHER TIPS

If you want to apply a style to the images use this macro:

Sub set_image_to_figure_style()
  Dim pic As InlineShape
  For Each pic In ActiveDocument.InlineShapes
    pic.Select
    Selection.Style = ActiveDocument.Styles("Figure")
  Next
End Sub
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top