View Single Post
  #1  
Old 27-02-2014, 12:00
byteme67's Avatar
byteme67 byteme67 is offline
Junior Member
 
Join Date: Apr 2010
Location: Fort Misery
Posts: 25
Default Open/close color palettes with vba user form

Okay I know in the later versions of CD that you can open the docker attach it and open and close the palettes from there. But I have created a userform using radio buttons to quickly select the palettes I want open or closed. e.g. I want just my Spot Color palettes open when I want to create something using the spot color palettes. Or CMYK palettes when creating something with CMYK colors.
But here is where I am at a loss. I have a checkbox on the user form that allows me to either keep the Document Palette open or closed. I cannot figure out how to correctly code this.
Also if anyone can give me advice on how to code it better it is always appreciated.
Here is the raw code and the userform is attached.
Code:
Private Sub CheckBox1_Click()
    
    'Palettes.Open "C:\Program Files\Corel\CorelDRAW Graphics Suite X6\Color\Palettes\dynamic.xml"
    LoadPalette = "Document Palette"
    
End Sub

Private Sub CommandButton1_Click()
    
    Unload frmColorPal
    
End Sub
Private Sub optPalsClose_click()

    Dim pal As Palette
    
    For Each pal In Palettes
        pal.Close
    Next pal

End Sub
Private Sub optCMYKcolors_click()

    Call optPalsClose_click
    
    'load the CMYK color palettes
    With Palettes
        .Open "C:\Program Files\Corel\CorelDRAW Graphics Suite X6\Color\Palettes\Process\trumatch.xml"
        .Open "C:\Program Files\Corel\CorelDRAW Graphics Suite X6\Color\Palettes\defcmyk.xml"
        .Open "C:\Program Files\Corel\CorelDRAW Graphics Suite X6\Color\Palettes\defrgb.xml"
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\My CMYKs\Xerox 7750.xml"
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\My CMYKs\NewCMYKs.xml"
    End With
    
'   Palette.Default "Xerox 7750.cpl"

End Sub
Private Sub optPalsBlk_click()

    Call optPalsClose_click

    'load just the black with screen palette
    Palettes.Open "C:\Documents and Settings\Rob\My Documents\My Palettes\My Spots\Black (screened).xml"
End Sub
Private Sub optPalsPMScolors_click()

    Call optPalsClose_click

    'load all standard PMS colors palettes
    With Palettes
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\My Spots\StdColors.xml"
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\My Spots\StdLight.xml"
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\My Spots\StdMetallic.xml"
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\My Spots\Black (screened).xml"
    End With
End Sub
Private Sub optBCEcolors_click()

    Call optPalsClose_click
    
    'load BCE standard colors
    With Palettes
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\BCE\24 Hour.xml"
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\BCE\48 Hour Standard.xml"
    End With
    
End Sub

Private Sub optLabelArt_click()

    Call optPalsClose_click
    
    'load BCE standard colors
    With Palettes
        .Open "C:\Documents and Settings\Rob\My Documents\My Palettes\LabelArt\Standard Colors.xml"
    End With

End Sub
Attached Files
File Type: zip frmColorPal.zip (1.9 KB, 510 views)
Reply With Quote