Share via


Document.ColorMode Property

Publisher Developer Reference

Returns a PbColorMode constant that represents the color mode for the publication. Read-only.

Syntax

expression.ColorMode

expression   A variable that represents a Document object.

Return Value
PbColorMode

Remarks

The ColorMode property value can be one of the PbColorMode constants declared in the Microsoft Office Publisher type library.

Example

This example creates a spot-color plate collection, adds two plates to it, and then enters those plates into the spot-color mode.

Visual Basic for Applications
  Sub CreateSpotColorMode()
    Dim plArray As Plates
With ThisDocument
    'Creates a color plate collection,
    'which contains one black plate by default
    Set plArray = .CreatePlateCollection(Mode:=pbColorModeSpot)

    'Sets the plate color to red
    plArray(1).Color.RGB = RGB(255, 0, 0)

    'Adds another plate, black by default and
    'sets the plate color to green
    plArray.Add
    plArray(2).Color.RGB = RGB(0, 255, 0)

    'Enters spot color mode with above
    'two plates in the plates array
    If .<strong>ColorMode</strong> = pbColorModeSpot Then
        .EnterColorMode pbColorModeSpot, plArray
    End If
End With

End Sub

See Also