View Single Post
Old 18-01-2011, 17:12
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default working with tables cql or not

Any ideas I get a "Object no longer exists" with this code when more than one table is on the page?
The code is supposed to change all text in tables on the page to red.

Also is there any cql to narrow the shaperange down to only the text inside?


Sub MyTableTextColorChanger()

    Dim s As Shape, sr As ShapeRange, i As Long, j As Long
    Dim sText As Shape, sSel As Shape
    Set sr = ActivePage.Shapes.FindShapes(Query:="@type='plugin:table'")

    For i = 1 To sr.count
        For j = 1 To sr(i).Custom.cells.count
                Set s = sr(i).Custom.cells(j).TextShape
                If s.Type <> cdrCustomShape And Len(s.text.Story.Characters.All) Then
                    s.Fill.UniformColor.RGBAssign 255, 0, 0
            End If
        Next j
        Set s = sr(i).Custom.cells(i).TextShape
    Next i
End Sub
Reply With Quote