I still work with X3. I read that X3 has cql query as a new feature. So I try:Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=0 and .m=24 and .y=47 and .k=45]")and I tried:Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk (0,24,47,45)")But no matter what I try the shaperange contains all objects on the page.The old school findshapes does work: Set sr = ActivePage.Shapes.FindShapes(Type:=cdrTextShape)Please help me, I want to use the query.
I have X8. the first one like: [.c = 0 and .m = 24 and .y = 47 and .k = 45]work goodAlso workSet SR = ActivePage.Shapes.FindShapes(Query:="@fill.color = cmyk(" & 0 & "," & 24 & "," & 47 & "," & 45 & ")")As Mek's link
I guess this is about me using X3. Cannot find any information on that and I get no error code...Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=0 and .m=24 and .y=47 and .k=45]")I still get a shaperange containing all objects on the page.Or should I use .CreateSelection after the code?Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=0 and .m=24 and .y=47 and .k=45]").CreateSelectionThat would be strange, since I don't have to do that here : Set sr = ActivePage.Shapes.FindShapes(Type:=cdrTextShape)
correctly works as next Dim SR As ShapeRange Set SR = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=0 and .m=0 and .y=0 and .k=100]") SR.CreateSelection And also Set SR = ActivePage.Shapes.FindShapes(Type:=cdrTextShape) SR.CreateSelectionTaras
Okay, I'll try.
Whatever I try the query doesn't limit the results. So I get all shapes from Set SR = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=0 and .m=0 and .y=0 and .k=100]")Even when I add sr.CreateSelection
This must have something to do with X3
I don't think there is a problem with X3.It is true that now few people use this version.I use X5 and feel myself as Mohican.
I can't quite understand what the problem is because you only show one line of code. Throw in all the macro text here please.
I think I know how to check what I do.... I set a shaperange and then the window with variables shows the total number of shapes in that range (count). In that way I can see what Corel does with my code. That's how I see that the query doesn't make the shaperange smaller. I also tried queries for font with text and other stuff.I had the idea of checking 'help' in the X3 editor and there's nothing on query. I think X3 cannot work with queries or X3 has a strange syntax for queries or maybe I have to change a setting that nobody knows about. It's strange that there's no error either.The good thing is that a query is only a shortcut. I've tried for hours to get it working, but now I'll just work around it and make code for searching in shaperanges.