![]() |
#1
|
|||
|
|||
![]()
Hi all,
I would like to be able to select all the objects in a document and convert their properties to CMYK at the same time. I have tried with the text below but it isn't working. I'm fairly certain that its possible and very easy to do. Could anybody please help a useless programmer. Many Thanks ![]() Also while i'm asking. I would like to select all objects of a certain color. I know it can be done because there is a find object wizard. I'm guessing that there is some code that can replicate this. CorelDRAW.CorelScript.SelectAllObjects Set q = CorelDRAW.ActiveSelection q.Outline.Color.ConvertToCMYK |
#2
|
||||
|
||||
![]()
It is not as easy as it may sound. There is no one-shot command which would find objects by their fill or outline colors but you can do it fairly easily yourself. You can take a look at Oberon Color Replacer which does exactly that - going through all objects and replacing one color with another.
Here is a simplified version of the code using in the Color Replacer macro which goes through all objects and converts fill and outline colors to CMYK: Code:
Public Sub ConvertAllColorsToCMYK() ConvertShapes ActivePage.Shapes End Sub Private Sub ConvertShapes(ss As Shapes) Dim s As Shape For Each s In ss Select Case s.Type Case cdrTextShape, cdrRectangleShape, cdrPolygonShape, _ cdrLinearDimensionShape, cdrEllipseShape, cdrCurveShape, _ cdrConnectorShape, cdrBitmapShape ConvertShapeColors s Case cdrGroupShape ConvertShapes s.Shapes End Select On Error Resume Next If Not s.PowerClip Is Nothing Then ConvertShapes s.PowerClip.Shapes End If Next s End Sub Private Sub ConvertShapeColors(s As Shape) Dim c As FountainColor ' 1. Convert Fill colors Select Case s.Fill.Type Case cdrUniformFill ConvertColor s.Fill.UniformColor Case cdrPatternFill ConvertColor s.Fill.Pattern.FrontColor ConvertColor s.Fill.Pattern.BackColor Case cdrFountainFill ConvertColor s.Fill.Fountain.StartColor ConvertColor s.Fill.Fountain.EndColor For Each c In s.Fill.Fountain.Colors ConvertColor c.Color Next c End Select ' 2. Convert outline color If s.Outline.Type = cdrOutline Then ConvertColor s.Outline.Color End If End Sub Private Sub ConvertColor(c As Color) c.ConvertToCMYK End Sub |
![]() |
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 |
fit objects to path edges | geopig | Other Oberon Commercial Products | 1 | 02-08-2006 23:28 |
Find objects by properties | Webster | CorelDRAW/Corel DESIGNER VBA | 8 | 01-12-2004 18:51 |
Need help accessing objects in a group | ama | CorelDRAW/Corel DESIGNER VBA | 5 | 20-02-2004 11:28 |
replace objects of certain color | jwknight | CorelDRAW/Corel DESIGNER VBA | 3 | 14-08-2003 12:43 |
I need to update objects visibility faster | NEHovis | Corel Photo-Paint VBA | 0 | 18-07-2003 07:54 |