该属性返回或设置一个 Long 类型的数值,表示 CMYK 颜色中的青色部分。只读。
expression.Cyan
expression 必需。该表达式返回“应用于”列表中的一个对象。
本示例创建一个新的图形,从活动文档的现有图形中获取四个 CMYK 值,然后将新图形的 CMYK 填充颜色设为相同的 CMYK 值。
Sub ReturnAndSetCMYK()
Dim lngCyan As Long
Dim lngMagenta As Long
Dim lngYellow As Long
Dim lngBlack As Long
Dim shpHeart As Shape
Dim shpStar As Shape
Set shpHeart = ActiveDocument.Shapes(1)
Set shpStar = ActiveDocument.Shapes.AddShape _
(Type:=msoShape5pointStar, Left:=200, _
Top:=100, Width:=150, Height:=150)
'Get current shapes CMYK colors
With shpHeart.Fill.ForeColor
lngCyan = .Cyan
lngMagenta = .Magenta
lngYellow = .Yellow
lngBlack = .Black
End With
'Setsnew shape to current shapes CMYK colors
shpStar.Fill.ForeColor.SetCMYK _
Cyan:=lngCyan, Magenta:=lngMagenta, _
Yellow:=lngYellow, Black:=lngBlack
End Sub