ColorsInUse Property

Microsoft Publisher Visual Basic

Show All Show All

ColorsInUse Property

Returns a ColorsInUse collection that represents the colors present in the current publication. Read-only.

expression.ColorsInUse

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

The ColorsInUse collection supports all the publication color models: RGB, process colors, and spot color.

For process color and spot color publications, colors are based on inks. For a given ink, a publication may contain several colors that are different tints or shades of that ink. Use the Plates collection to access the plates that represent the inks defined for a publication.

This property corresponds to the Colors tab of the Color Printing dialog box.

Example

The following example lists properties of each color in the active publication that is based on the specified ink. This example assumes the publication's color mode has been defined as spot color or process and spot color.

    Sub ListColorsBasedOnInk()
Dim cfLoop As ColorFormat

For Each cfLoop In ActiveDocument.ColorsInUse
    
    With cfLoop
        If .Ink = "2" Then
            Debug.Print "BaseRGB: " & .BaseRGB
            Debug.Print "RGB: " & .RGB
            Debug.Print "TintShade: " & .TintAndShade
            Debug.Print "Type: " & .Type
        End If
    End With

Next cfLoop

End Sub