Belch
04-27-2006, 02:18 AM
Hi all,
I have some AutoShapes (rectangles) in the Header/Footer part of a document template, and I need to select specific ones and change the fill color and line width.
I have recorded a macro to get the basic code and taken the lines I need. However in terms of actually selecting the rectangles, the macro code selects them using the name "Freeform nnn" where nnn is a number (which seems quite random).
I was just wondering if there is any way of giving the rectangles explicit names rather than having to record a macro each time I want to find out what a rectangle is called.
My code for selecting and amending a rectangle is below:
Selection.HeaderFooter.Shapes("Freeform 449").Select
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Line.BeginArrowheadStyle = msoArrowheadNone
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadNone
Any info appreciated,
I have some AutoShapes (rectangles) in the Header/Footer part of a document template, and I need to select specific ones and change the fill color and line width.
I have recorded a macro to get the basic code and taken the lines I need. However in terms of actually selecting the rectangles, the macro code selects them using the name "Freeform nnn" where nnn is a number (which seems quite random).
I was just wondering if there is any way of giving the rectangles explicit names rather than having to record a macro each time I want to find out what a rectangle is called.
My code for selecting and amending a rectangle is below:
Selection.HeaderFooter.Shapes("Freeform 449").Select
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Line.BeginArrowheadStyle = msoArrowheadNone
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadNone
Any info appreciated,