ActiveDocument.Unit = cdrMillimeter
Dim s As shape
Dim gr As New ShapeRange
Dim CStext As String
Set sr = ActiveSelectionRange.Shapes.FindShapes(query:="@type!='group'", Recursive:=True)
Dim CSPalette As Palette
Set CSPalette = Palettes.CreateFromSelection("BlockColors", , True) 'sozdal palitru
Dim CSColor As color
For Each CSColor In CSPalette.colors
CStext = CSColor.Name(True)
For Each s In sr.Shapes ' perebor kagdogo shape v videlenii
Set so = s.Fill.UniformColor
s.Outline.SetProperties 0.1, , so, , , , , cdrOutlineRoundLineCaps, cdrOutlineRoundLineJoin
If s.Fill.UniformColor.IsSame(CSColor) Then gr.Add s
Next s
gr.Group.ObjectData("Name").Value = CStext
Next CSColor