OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 20-10-2004, 20:07
Posts: n/a
Default Suggestion - palette from existing drawing

I've been playing around with a macro to create a new palette from an existing .cdr. Maybe someone can short-cut my quest.

The main reason is to augment the already excellent ColorReplacer.

ATM, you have to "know" which colour to replace. But what if you (say) have two greens - one C 100, M 0, Y 90, K 0 and another C 100, M 0, Y 95, K 0.

Both will look the same on the screen, and one or the other could easily be missed. If you had a palette of all colours in the drawing (that would then be accessible in ColorReplacer), you could easily click on and replace (say) green #1 with PMS 334, green #2 with PMS 334, green #3 with PMS 334 etc without knowing what the greens actually are.

Any helpers?

Reply With Quote
Old 21-10-2004, 01:25
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: Suggestion - palette from existing drawing

Look at the following method: Application.Palettes.CreateFromDocument. This should help
Reply With Quote
Old 21-10-2004, 18:16
Posts: n/a

Eh Eh, silly me.

The code example for Corel 10......

Dim MyPalette as Palette
Set MyPalette = Palettes.CreateFromPalette ("My New Palette", False)

Managed to work it out.

So, I've added a command button to the ColorReplacer form with...

Dim MyPalette As Palette
Set MyPalette = Palettes.CreateFromDocument("CurrentPalette", True)

....and the colors in the drawing are available in the new palette.

Reply With Quote
Old 22-10-2004, 03:18
Posts: n/a

still better is:
Sub PaletteausDatei()
    If Documents.Count > 0 Then
        Dim MyPalette As Palette
        For Each MyPalette In Palettes
            If MyPalette.Name = "CurrentPalette" Then
            End If
        Next MyPalette
        Set MyPalette = Palettes.CreateFromDocument("CurrentPalette", , True)
    End If
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
Palette (or Colors array) property in VBA class in CDR12 zlatev CorelDRAW/Corel DESIGNER VBA 7 22-02-2005 11:28
How to set palette as default palette with VBA ? hmalme CorelDRAW/Corel DESIGNER VBA 1 22-12-2004 13:26

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

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