View Single Post
 
Old 08-09-2017, 09:42 PM
Karin Carlson Karin Carlson is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2017
Posts: 4
Karin Carlson is on a distinguished road
Smile yippee!

Thank you very much for your help -- for the benefit of others and for posterity, here's what I am using. I have two sub routines. (Added a 3rd which includes a loop so it does all the selected shapes.)

1 - Changes a selected shape with a number in it to a cute little red circle .18" h/w, and applies a style (Stepcircles) to the number inside the circle.

Code:
Sub redCircle()
With Selection.ShapeRange(1)
    .AutoShapeType = msoShapeOval
    .Fill.ForeColor.RGB = RGB(255, 255, 255)
    .Fill.BackColor.RGB = RGB(255, 255, 255)
    .Line.Weight = 1
    .Line.ForeColor.RGB = RGB(255, 0, 0)
    .Height = InchesToPoints(0.18)
    .Width = InchesToPoints(0.18)
    .TextFrame.TextRange.Style = "Stepcircles"
    .TextFrame.MarginBottom = 0
    .TextFrame.MarginRight = 0
    .TextFrame.MarginTop = 0
    .TextFrame.MarginLeft = 0
    
    End With
End Sub
2 - Changes a selected shape to a red rectangle that has a 1pt border.

Code:
Sub redOutlineOneRectangle()
    With Selection.ShapeRange(1)
        .AutoShapeType = msoShapeRectangle
        .Line.Weight = 1
        .Line.ForeColor.RGB = RGB(255, 0, 0)
        End With

End Sub
3 - Same as #1, but will do all the shapes in the selection.

Code:
Sub redCircles()

Dim allShapes As ShapeRange
Dim myShape As Shape

Set allShapes = Selection.ShapeRange

For Each myShape In allShapes
    
  
With myShape
    .AutoShapeType = msoShapeOval
    .Fill.ForeColor.RGB = RGB(255, 255, 255)
    .Fill.BackColor.RGB = RGB(255, 255, 255)
    .Line.Weight = 1
    .Line.ForeColor.RGB = RGB(255, 0, 0)
    .Height = InchesToPoints(0.18)
    .Width = InchesToPoints(0.18)
    .TextFrame.TextRange.Style = "Stepcircles"
    .TextFrame.MarginBottom = 0
    .TextFrame.MarginRight = 0
    .TextFrame.MarginTop = 0
    .TextFrame.MarginLeft = 0
    
    End With
    
Next myShape
End Sub

Last edited by Karin Carlson; 08-09-2017 at 10:07 PM. Reason: added another code example with loop
Reply With Quote