OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Thread Tools Search this Thread Display Modes
Old 12-04-2019, 11:18
ajesion ajesion is offline
Junior Member
Join Date: Aug 2010
Posts: 17
Default Problem with macro (conversion to CMYK)

Please help. The macro conversion to CMYK worked in Coreldraw 16. It does not work in CorelDraw 18.

Public Sub druk()
ActiveDocument.BeginCommandGroup "wCMYK"
    ConvertShapes ActivePage.Shapes
    MsgBox "Konwersja CMYK zako?czona."
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
'wskazanie koloru wype?nienia
    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
'wskazanie koloru konturu
    If s.Outline.Type = cdrOutline Then
        ConvertColor s.Outline.Color
    End If
End Sub

Private Sub ConvertColor(c As CorelDRAW.Color)
'zamiana koloru
    With c
        .CMYKCyan = IIf(.CMYKCyan + .CMYKBlack > 100, 100, .CMYKCyan + .CMYKBlack)
        .CMYKMagenta = IIf(.CMYKMagenta + .CMYKBlack > 100, 100, .CMYKMagenta + .CMYKBlack)
        .CMYKYellow = IIf(.CMYKYellow + .CMYKBlack > 100, 100, .CMYKYellow + .CMYKBlack)
        .CMYKBlack = 0
    End With
'zamiana palety bitmap
    For Each s In ActivePage.Shapes.FindShapes(Type:=cdrBitmapShape)
        If s.Bitmap.Mode <> cdrCMYKColorImage And s.Bitmap.Mode <> cdrGrayscaleImage Then
            s.Bitmap.ConvertTo cdrCMYKColorImage
        End If
    Next s
End Sub
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with printing through a macro IngoInternet General 3 02-10-2012 01:04
wOxxOm macro problem linearg Macros/Add-ons 2 20-01-2009 18:38
color conversion diwin CorelDRAW/Corel DESIGNER VBA 8 22-05-2007 19:55
CD11 Convert to Bitmap -> CMYK to Gray scale problem xenio General 7 24-07-2005 21:46
CorelDraw V3 conversion to V10+ rboyd General 0 02-06-2005 23:52

All times are GMT -5. The time now is 05:36.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com