Create a macro to put border on all sides of the selected picture

B

BobRoyAce

I am trying to create a macro that will put a border around a picture,
on all sides. The user will have to first select the picture, by
clicking on it. Then, they will fire off the macro, either with a
keyboard shortcut, or a button click. Upon doing so, I want the
picture to have borders on all sides. Here's the code that I tried,
but it seems to only put borders on the right and left sides. Any help
would be muchly appreciated.

--- MACRO CODE BEGINS ---

Selection.InlineShapes(1).Line.Weight = 1.25
Selection.InlineShapes(1).Line.DashStyle = msoLineSolid
Selection.InlineShapes(1).Line.Visible = msoTrue
Selection.InlineShapes(1).Line.ForeColor.RGB = RGB(0, 0, 0)

--- MACRO CODE ENDS ---
 
B

BobRoyAce

I think that I figured it out. The following code seems to do just
what I wanted...

--- MACRO CODE BEGINS ---

Selection.InlineShapes(1).Borders.OutsideLineStyle = wdLineStyleSingle
Selection.InlineShapes(1).Borders.OutsideLineWidth = wdLineWidth150pt
Selection.InlineShapes(1).Borders.OutsideColor = wdColorAutomatic

--- MACRO CODE ENDS ---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top