ColorSchemes object (Publisher)
A collection of all the ColorScheme objects in Microsoft Publisher. Each ColorScheme object represents a color scheme, which is a set of colors that are used in a publication.
Remarks
Use the Count property to return the number of color schemes available to Publisher.
Use the Item property to return a specific color scheme from the ColorSchemes collection. The Index argument of the Item property can be the number or name of the color scheme or a PbColorScheme constant.
Use the Name property to return a color scheme name.
Example
The following example displays the number of color schemes.
Sub CountColorSchemes()
MsgBox Application.ColorSchemes.Count
End Sub
The follow example sets the color scheme of the active publication to Wildflower.
Sub SetColorScheme()
ActiveDocument.ColorScheme _
= ColorSchemes.Item(pbColorSchemeWildflower)
End Sub
The following example lists in a text box all the color schemes available to Publisher.
Sub ListColorShemes()
Dim clrScheme As ColorScheme
Dim strSchemes As String
For Each clrScheme In Application.ColorSchemes
strSchemes = strSchemes & clrScheme.Name & vbLf
Next
ActiveDocument.Pages(1).Shapes.AddTextbox( _
Orientation:=pbTextOrientationHorizontal, _
Left:=72, Top:=72, Width:=400, Height:=500).TextFrame _
.TextRange.Text = strSchemes
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.