I need to change CMYK outlines to RGB. I think the following code will make the change but how what code would identify CMYK outlines?
For Each s In OrigSelection 'if CMYK black make RGB black s.SetOutlineProperties Color:=CreateRGBColor(0, 0, 255)Next s
Are you trying to convert all CMYK outlines to RGB? Or are you specifically trying to find CMYK black outlines and change them to RGB black?
I'm printing to a print driver that uses only "true" RGB colors (255,0,0, e.g.). So I need to convert CMYK black to RGB(0,0,0)
Also CMYK red to RGB(255,0,0)
If you want to go with the "for each s in sr" type of approach, you could try this:
Sub outlines_1() Dim sr As ShapeRange Dim s As Shape Set sr = ActiveSelectionRange For Each s In sr If s.Outline.Color.IsSame(CreateCMYKColor(0, 0, 0, 100)) Then s.Outline.Color.RGBAssign 0, 0, 0 End If Next s End Sub
.
Another approach might be to use Corel Query Language (CQL) to search a collection of shapes, then set the outline for all of the found shapes in one shot.
In this example, it would find all shapes on the page, including those in groups (but not content in PowerClips):
Sub outlines_2() Dim sr As ShapeRange Set sr = ActivePage.Shapes.FindShapes(Query:="@outline.color.cmyk = cmyk(0,0,0,100)") sr.SetOutlineProperties , , CreateRGBColor(0, 0, 0) End Sub
Thanks Eskimo. This will do it.
outlines_1 I understand and will probably use.
But, what documentation is available on CQL? That appears to be helpful in many cases and I'd like to learn more about it.
You're welcome, Roy.
My knowledge of CQL (and VBA, and the CorelDRAW API) is wildly incomplete. It comes from a mix of
For CQL, here is some material from Alex Vakulenko: Using Corel Query Language (CQL) to search for objects in CorelDRAW documents.
A lot of that is pretty heavy for me, but I'm getting some of it. When I revisit it after seeing other examples, and after trying it out myself, I find that I understand more of it than I did before.