ColorsInUse object (Publisher)
A collection of ColorFormat objects that represent the colors present in the specified publication.
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.
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
The following example returns properties for the second color in the publication.
Sub ColorProperties()
With ActiveDocument.ColorsInUse(2)
Debug.Print "Color RBG: " & .RGB
Debug.Print "Ink RBG: " & .BaseRGB
Debug.Print "Tint: " & .TintAndShade
End With
End Sub
Properties
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for