use cql in vsta

In the documentation cql is mentioned as query language for complex shape searching.

But all examples i find are for vba where it can be used in findshapes:

ActivePage.Shapes.FindShapes(Query:="@outline.type = 'none' and @fill.type = 'none'")


but how do i use this in vsta (c#)?


thanks in advance
Tom
Parents
No Data
Reply
  • What did you try?

    It should be something similar. This line should work:

    1
     corelApp.ActiveDocument.ActivePage.Shapes.FindShapes(null, corel.cdrShapeType.cdrNoShape, true, "@outline.type = 'none' and @fill.type = 'none'");
    

    You can 'help' the function (if the case) using the shape name instead of 'null', the shape type for the second parameter...

    I think this code should also work (even more similar). I cannot test it...

    1
    corelApp.ActiveDocument.ActivePage.Shapes.FindShapes(Query:"@outline.type = 'none' and @fill.type = 'none'");
    

    Of course, you must allocate the function result to a ShapeRange variable...

    In fact, when you open the function parenthesis VS will show you which to be the accepted options for the parameters. 

Children