API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.AddColorsToDocPalette method
Adds all the colors in the document or selection to the document color palette
Syntax:
Function AddColorsToDocPalette(Optional ByVal SelectedOnly As Boolean = False, Optional ByVal MaxColorsPerBitmap As Long = -1) As Boolean
Parameters:
Name Type Description
SelectedOnly
Boolean
Specifies whether to add only the colors of the selection to the document palette.
MaxColorsPerBitmap
Long
Specifies the maximum number of colors from bitmaps to be added to the document palette. The maximum value of this parameter is 256.
Remarks:
The AddColorsToDocPalette method adds all colors in a document or selection to the document palette.