scody
19-10-2011, 01:46
Pls see code below.
i have several symbols with text and objects that requires no fill and no stroke. I want to select symbols , select all contents (shapes & text) and make them all no fill. is my code correct?
Sub NoFill()
Dim s As Shape, s1 As Shape, sr As ShapeRange, sr2 As ShapeRange
Dim str1$, str2$
str2 = ""
Set sr = ActiveSelection.Shapes.FindContent(Query:="@content = 'symbol'")
For Each s In sr
str1 = s.Symbol.Definition.Name
If InStr("-*-" & str2 & "-*-", str1) = 0 Then
str2 = str2 & "-*-" & str1 & "-*-"
s.Symbol.Definition.EnterEditMode
Set sr2 = ActiveLayer.Shapes.FindShapes(Query:="@shape = 'shape'")
For Each s1 In sr2
s1.Fill.ApplyNoFill
Next s1
s.Symbol.Definition.LeaveEditMode
End If
Next s
sr.CreateSelection
End Sub
i have several symbols with text and objects that requires no fill and no stroke. I want to select symbols , select all contents (shapes & text) and make them all no fill. is my code correct?
Sub NoFill()
Dim s As Shape, s1 As Shape, sr As ShapeRange, sr2 As ShapeRange
Dim str1$, str2$
str2 = ""
Set sr = ActiveSelection.Shapes.FindContent(Query:="@content = 'symbol'")
For Each s In sr
str1 = s.Symbol.Definition.Name
If InStr("-*-" & str2 & "-*-", str1) = 0 Then
str2 = str2 & "-*-" & str1 & "-*-"
s.Symbol.Definition.EnterEditMode
Set sr2 = ActiveLayer.Shapes.FindShapes(Query:="@shape = 'shape'")
For Each s1 In sr2
s1.Fill.ApplyNoFill
Next s1
s.Symbol.Definition.LeaveEditMode
End If
Next s
sr.CreateSelection
End Sub