Chris Macro
Well-known Member
- Joined
- Nov 2, 2011
- Messages
- 1,345
- Office Version
- 365
- Platform
- Windows
Hi,
I have been doing alot of macros in excel and am now trying to venture into making a few in Word. I recorded a macro that creates a rectangle with no fill and a red border. For some reason the shape is only appearing near the top of my page (where I recorded inserting it) instead of the line I am on. Is there any way to make the shape appear on the line I am on? Thanks!
code:
I have been doing alot of macros in excel and am now trying to venture into making a few in Word. I recorded a macro that creates a rectangle with no fill and a red border. For some reason the shape is only appearing near the top of my page (where I recorded inserting it) instead of the line I am on. Is there any way to make the shape appear on the line I am on? Thanks!
code:
Code:
Sub Highlight_Box()
ActiveDocument.Shapes.AddShape(msoShapeRectangle, 90#, 183#, 69.75, _
18#).Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Line.ForeColor.ObjectThemeColor = wdThemeColorAccent2
Selection.ShapeRange.Line.ForeColor.TintAndShade = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.Weight = 2.25
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.Style = msoLineSingle
End Sub