Share via


SetCMYK Method [Publisher 2003 VBA Language Reference]

Sets a cyan-magenta-yellow-black (CMYK) color value.

expression.SetCMYK(Cyan, Magenta, Yellow, Black)

expression Required. An expression that returns a ColorCMYK object.

Cyan  Required Long. A number that represents the cyan component of the color. Value can be any number between 0 and 255.

Magenta  Required Long. A number that represents the magenta component of the color. Value can be any number between 0 and 255.

Yellow  Required Long. A number that represents the yellow component of the color. Value can be any number between 0 and 255.

Black  Required Long. A number that represents the black component of the color. Value can be any number between 0 and 255.

Example

This example sets the CMYK color for the specified shape.

Sub SetCMYKColor()
    Dim shpStar As Shape

    Set shpStar = ActiveDocument.Pages(1).Shapes _
        .AddShape(Type:=msoShape5pointStar, Left:=72, _
        Top:=72, Width:=150, Height:=150)
    shpStar.Fill.ForeColor.CMYK.SetCMYK Cyan:=0, _
        Magenta:=255, Yellow:=255, Black:=50
End Sub

Applies to | ColorCMYK Object