Search code examples
vbacolorswidthcontourcoreldraw

Coreldraw Multiple Contours in VBA


Guys I Am trying to set up a three colour text that is editable

Basically what I want is the text to be black

A 1st contour of 1mm that is white

a 2nd contour of 2mm thick which is black

I have tried the following 2 step contour

ActiveSelection.CreateContour cdrContourOutside, 2, 2, , , CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255)

this works perfectly as I want and when I edit the text the contour changes to the new text however the contours are both the same width (2mm) and not 1 & 2mm as i want

Also I cant get it to specify the correct color for each contour

If I break apart the 1st contour then add another this gives me contours of different widths and colors but I then loose the edit ability as the contour is not attached to the text

Any Ideas I Know its possible as I have seen a commercial macro that does it

Any Help appreciated

Mark


Solution

  • The best I can do for you is to show you the object model. I do not have CorelDraw and therefore cannot test anything.

    Here is the link to the CorelDraw Object Model. http://apps.corel.com/partners_developers/csp/resources/CorelDRAW%20VBA%20Object%20Model.pdf

    And here is a link to a Programming Guide for CorelDraw. http://apps.corel.com/partners_developers/csp/resources/dvba_pg.pdf

    You can look up "Applying Effects" on page 72 of the programming guide which may help.

    I would suggest also looking at creating curves from the .Shapes object and then looking at the TextRange object. the TextRange.Text property is the actual text you want to see and the TextRange.colorindex is the color of the text I believe. You will have to do some exploring, but this should help.