I am entirely new to VBA and am trying to learn from already posted examples but need a little boost from experts.
I am trying to create Word template that displays a grey sidebar with text for instructions on each page. When users create a new page, I would like to provide them with a macro that easily places the same sidebar on the new page.
This is what I could find so far:
Sub Sidebar()
Application.ScreenUpdating = False
Dim Shp As Shape, Rng As Range, Hght As Single, Wdth As Single
Hght = InchesToPoints(11): Wdth = InchesToPoints(2.17)
With ActiveDocument
Set Shp = .Shapes.AddShape(Type:=msoShapeRectangle, _
Left:=RelativeVerticalPosition = 0, _
Top:=RelativeHorizontalPosition = 0 - Hght, _
Width:=Wdth, Height:=Hght)
End With
Application.ScreenUpdating = True
End Sub`
It beautifully places the sidebar in the correct place with the correct dimensions. However, it is, in accordance with my theme colors, green. How do I alter the code to change he fill and outline color?
M L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.