TextureName Property

Microsoft Publisher Visual Basic

expression.TextureName

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

Use the UserTextured method to set the texture file for the fill.

Example

This example adds an oval to the active publication. If shape one on the active publication has a fill with a user-defined texture, the new oval will have the same fill as shape one. If shape one has any other type of fill, the new oval will have a green marble fill.

Dim ffNew As FillFormat

With ActiveDocument.Pages(1).Shapes
    Set ffNew = .AddShape(Type:=msoShapeOval, _
        Left:=0, Top:=0, Width:=200, Height:=90).Fill

    With .Item(1).Fill
        If .Type = msoFillTextured And _
                .TextureType = msoTextureUserDefined Then
            ffNew.UserTextured _
                TextureFile:=.TextureName
        Else
            ffNew.PresetTextured _
                PresetTexture:=msoTextureGreenMarble
        End If
    End With
End With