Object Model Reference : Classes : P : Palettes : Methods : Palettes.CreateFromDocument |
Function CreateFromDocument(Name As String, [FileName As String], [Overwrite As Boolean = False]) As Palette
Member of Palettes
The CreateFromDocument method creates a new custom color palette based on the colors used in the active document.
The following VBA example displays the number of colors used in the active document.
Sub Test() |
Dim pal As Palette |
Set pal = Palettes.CreateFromDocument("Document Colors", _ |
Application.UserDataPath & "Palettes\DocColors.xml", True) |
MsgBox "The document uses " & pal.ColorCount & " colors" |
pal.Close |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.