GDG Code Chunks, Discussion, VBA Snippets for CorelDRAW, Simple Macro Helpers!

cool vba macros for corel show cart gdg corel draw macros checkoutMyAccount corel macros
VBA Corel Macro Help
john's macros
thanks for stopping by gdg macros















Helpful VBA Code

Nothing on CorelDraw 2026 macros yet. I will keep you posted.
NEW for CorelDraw 2025: GDG Color Click SUPREME

GDG Macros Suite 2023 and GDG Macros Suite 2024 and GDG Macros Suite 2025
(older versions of the products available below, as well)

Join me on Facebook to stay up to date with news, updates. Subscribe to my YouTube Channel for tutorial videos and tips. Need a custom macro? Contact me.
Not all macros are guaranteed to be continued due to compatibility reasons or other. Read new-version policy here.
I appreciate everyone! Upgrading macros and maintaining this site is quite a task for me. Want to contribute? Please DONATE
^ Hide these messages to save screen space ^

<<Back to helpful code list

Find and replace colors, Even in powerclips

Decription: This is a simple find and replace script. It works by selecting the first color you want replaced with the first click and the second color you want to replace it with, with the second click. Comment out the msgbox lines once you become comfortable with it.

Date: 2010-05-04 Author: John

Code:
Option Explicit


Sub replaceColorsGDG()

Dim col As New Color, col2 As New Color
Dim orig As Shape, smith As Shape
Dim s As Shape, sp As Shape
Dim pwc As PowerClip
Dim x As Double, y As Double
Dim Shift As Long
Dim a As Boolean, b As Boolean

 
 MsgBox "Select shape with the color you need replace", , "GDG"
 a = False
 While Not a
  a = ActiveDocument.GetUserClick(x, y, Shift, 10, False, cdrCursorEyeDrop)
  If Not a Then
        Set orig = ActivePage.SelectShapesAtPoint(x, y, False)
        col.CopyAssign orig.Fill.UniformColor
        ActiveDocument.ClearSelection
        GoTo 1001
    End If
 Wend
1001:
MsgBox "Select shape with the color you need applied", , "GDG"

 b = False
 While Not b
  b = ActiveDocument.GetUserClick(x, y, Shift, 10, False, cdrCursorEyeDrop)
  If Not b Then
        Set smith = ActivePage.SelectShapesAtPoint(x, y, False)
        col2.CopyAssign smith.Fill.UniformColor
        ActiveDocument.ClearSelection
        GoTo 1002
    End If
 Wend
1002:

For Each s In ActivePage.FindShapes
    If s.Fill.Type = cdrUniformFill Or Not s.PowerClip Is Nothing Then
        Set pwc = Nothing
        On Error Resume Next
        Set pwc = s.PowerClip
        On Error GoTo 0
        If Not pwc Is Nothing Then
            
            For Each sp In pwc.Shapes
            'sp.CreateSelection
            If sp.Fill.Type = cdrUniformFill Then
                If sp.Fill.UniformColor.IsSame(col) Then '
                    sp.Fill.ApplyUniformFill col2
                End If
            End If
        Next sp
        Else
            If s.Fill.UniformColor.IsSame(col) Then '
                s.Fill.ApplyUniformFill col2
            End If
        End If
    End If
Next s


End Sub


Title:
Comment left by: xilense
Date: 2013-03-18
Comment left:
TQ TQ TQ
u r great!!



gdg


Title: oswaldo
Comment left by: oswaldo
Date: 2012-09-29
Comment left:
HOLA quiesiera que hagas un tuto de como empleo el codigo ....... e intentado de harcerlo y no he tenido exito.... gracias si no es mucha molestia



gdg


Title: corel.com(coşkun edip) turkey
Comment left by: coşkun edip soykan
Date: 2012-09-10
Comment left:
Hi john, What is the code how this process powerclip in powerclip in powerclip in powerclip...and 
textpowerclip for text in textpowerclip .... What is the loop code
and convert rgb-cmyk bitmap rgbcolor powerclip in powerclip in powerclip.... What is the code in powerclip

thanks john



gdg




First Previous


corel macros boost workflow
*Searches the FREE and Commercial Macros


GDG Macros for CorelDraw 2025
\
CorelDraw macros for version 2024

CorelDraw macros for version 2023

CorelDraw macros for version 2022

CorelDraw macros for version 2020

CorelDraw macros for version 2019

CorelDraw macros for version 2018

CorelDraw macros for version 2017

macros for coreldraw x8

macros for coreldraw x7

macros for corel draw x6

macros for corel draw x6

FIND IT ON

find it on yahoo

FIND IT ON

find it on google