OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 26-01-2009, 05:13
Posts: n/a
Default color palette and powerclip

To find the colors used in a document I use createfromdocument function, to place all the colors in a palette. But if all the objects in the document are inside a powerclip, the palette is empty, as if I have no colors. Is there a way to fix that?
Reply With Quote
Old 21-02-2009, 03:09
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Try this...

I have only tested this in X4, but it seems to work. Basically I copy all the shapes in the powerclip to another layer, create the palette, then delete the layer.
Sub CreatePalette()
    Dim s As Shape
    Dim sr As New ShapeRange
    Dim lr As Layer
    Dim pal As Palette
    Set lr = ActivePage.CreateLayer("PowerClip")
    For Each s In ActivePage.Shapes
        If Not s.PowerClip Is Nothing Then
            s.PowerClip.Shapes.FindShapes.CopyToLayer lr
        End If
    Next s
    Set pal = Palettes.CreateFromDocument("Document Colors", _
              Application.UserDataPath & "Palettes\DocColors.cpl", True)
End Sub
Hope it works for you.

Reply With Quote
Old 21-02-2009, 05:22
Joe Joe is offline
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe

I did it by adding ALL the shapes on the page to a selection (iterating through the shapes inside the powerclip as well) and then calling a Palettes.CreateFromSelection command. But you'd have to do that for each page. I may be a little faster than copying everything out to a layer, though.
Reply With Quote
Old 22-02-2009, 09:35
Posts: n/a

Thank you both for your help
Reply With Quote
Old 25-01-2013, 16:35
ostwald ostwald is offline
Junior Member
Join Date: May 2012
Location: peru
Posts: 5

have doubt ..
as I could do to carry a 'frame' colors
q were created within the document .......
here are some picture

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
populate combobox with palette color bprice CorelDRAW/Corel DESIGNER VBA 2 23-07-2008 06:47
CMYK color Palette in CORELDRAW X3 whitechapel General 2 20-04-2007 03:29
Color palette in CorelDraw 12 CorelUser General 1 02-10-2005 15:51
How to set palette as default palette with VBA ? hmalme CorelDRAW/Corel DESIGNER VBA 1 22-12-2004 14:26
Finding Color Currently Selected in RGB or CMYK Palette AARRGGHHH CorelDRAW/Corel DESIGNER VBA 1 30-03-2004 10:03

All times are GMT -5. The time now is 02:23.

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