FillFormat.GradientStyle 属性 (Publisher)
返回一个 MsoGradientStyle 常量,该常量指示指定填充的渐变样式。 此为只读属性。
语法
表达式。GradientStyle
表达 一个代表 FillFormat 对象的变量。
返回值
MsoGradientStyle
备注
使用 OneColorGradient、 PresetGradient 或 TwoColorGradient 方法设置填充的渐变样式。
尝试对未使用渐变的填充返回此属性将生成错误。 使用 Type 属性决定填充是否使用渐变。
GradientStyle 属性值可以是在 Microsoft Office 类型库声明的 MsoGradientStyle 常量之一。
示例
本示例向当前出版物添加一个矩形,并将该矩形的填充渐变样式设置为与名为 rect1 的形状的填充渐变样式相同。 为了使本示例生效,rect1 必须具有渐变填充。
Dim intStyle As Integer
With ActiveDocument.Pages(1).Shapes
' Store gradient style of rect1.
intStyle = .Item("rect1").Fill.GradientStyle
' Add new rectangle.
With .AddShape(Type:=msoShapeRectangle, _
Left:=0, Top:=0, Width:=40, Height:=80).Fill
' Set color and gradient of new rectangle.
.ForeColor.RGB = RGB(128, 0, 0)
.OneColorGradient Style:=intStyle, _
Variant:=1, Degree:=1
End With
End With
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈