![]() |
#1
|
|||
|
|||
![]()
Hi there,
I'm trying to create a loop (in Coreldraw 11) that does the following to a selected set of curves: 1. checks to see if the curve is open or not, then 2. closes an open curve with a straight line segment, then 2. obtains the RGB color of the outline, then 3. applies this RGB color to a uniform fill Unfortunately, I'm not that experienced programming in VB and am not at all familiar with the object model in Coreldraw. Could anyone find it in there heart to post what i believe should be a relatively simple bit of code that i can use and learn from? Thanks, Dan |
#2
|
||||
|
||||
![]()
Dan,
Here is the code for you: Code:
Sub ApplyOutlineToFill() Dim s As Shape Dim clr As New Color ActiveDocument.BeginCommandGroup "Apply Outline To Fill" ' Go through all selected objects For Each s In ActiveSelection.Shapes ' If it is a curve and it is open, close it If s.Type = cdrCurveShape Then If Not s.Curve.Closed Then s.Curve.Closed = True End If If s.Type <> cdrGroupShape Then ' See if the object has an outline If s.Outline.Type = cdrOutline Then ' Get the outline color clr.CopyAssign s.Outline.Color ' Convert it to RGB clr.ConvertToRGB ' Apply to the fill s.Fill.ApplyUniformFill clr End If End If Next s ActiveDocument.EndCommandGroup End Sub |
#3
|
|||
|
|||
![]()
Alex,
This code worked like a charm... first shot. Thanks so much!! My "workaround" to accomplish this same thing was so cumbersome that it's too embarrasing to even share it with you. Now all i have to do is go buy a book and learn to do simple things like your code did for me. I might get so much more accomplished in a day that i can start leaving work early to play golf ![]() Dan |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simple Bar code generator | Webster | Code Critique | 2 | 06-09-2010 02:41 |
Installer for GMS | ssb | CorelDRAW/Corel DESIGNER VBA | 8 | 15-02-2005 03:22 |
simple example | chinkyk | CorelDRAW/Corel DESIGNER VBA | 3 | 19-10-2004 15:50 |
exporting to jpg | ddonnahoe | CorelDRAW/Corel DESIGNER VBA | 7 | 26-01-2004 12:53 |
Condition #1002 -Listman- 0737 (Wierd memory leaks issues) | wbochar | CorelDRAW/Corel DESIGNER VBA | 6 | 15-05-2003 17:48 |