TextureName 属性

       

返回指定填充的自定义纹理文件名称。只读。String 类型。

该属性为只读。使用 UserTextured 方法设置填充的纹理文件。

示例

本示例向 myDocument 中添加一个椭圆。如果 myDocument 的第一个形状使用用户定义的纹理填充,则新椭圆使用和第一个形状相同的填充。如果第一个形状使用其他任何类型的填充,则新椭圆使用绿色大理石填充。

Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes
    Set newFill = .AddShape(msoShapeOval, 0, 0, 200, 90).Fill
    With .Item(1).Fill
        If .Type = msoFillTextured And _
                .TextureType = msoTextureUserDefined Then
            newFill.UserTextured .TextureName
        Else
            newFill.PresetTextured msoTextureGreenMarble
        End If
    End With
End With