BlueStone
12-08-2013, 08:31 PM
Hi Experts,
I've some documents which contains quite a number of images, mainly screen capture images and I've been doing a manual work to manually add a border to each of these images. It's a very tedious work and very time consuming.
I've tried using a macro to handle the border, but only able to handle 1 image at a time. I've assigned this macro to a keyboard shortcut for ease of execution.
Here is my simple macro code:
Sub BorderMacro()
'
' BorderMacro Macro
'
'
With Selection.InlineShapes(1)
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
.Borders.Shadow = False
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth100pt
.DefaultBorderColor = wdColorAutomatic
End With
End Sub
Will it be possible to enhance this macro to handle all the existing images and add a border to each of the existing images in MS Word document?
Thank you.
- Blue
I've some documents which contains quite a number of images, mainly screen capture images and I've been doing a manual work to manually add a border to each of these images. It's a very tedious work and very time consuming.
I've tried using a macro to handle the border, but only able to handle 1 image at a time. I've assigned this macro to a keyboard shortcut for ease of execution.
Here is my simple macro code:
Sub BorderMacro()
'
' BorderMacro Macro
'
'
With Selection.InlineShapes(1)
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
.Color = wdColorAutomatic
End With
.Borders.Shadow = False
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth100pt
.DefaultBorderColor = wdColorAutomatic
End With
End Sub
Will it be possible to enhance this macro to handle all the existing images and add a border to each of the existing images in MS Word document?
Thank you.
- Blue