PictureFormat.TransparentBackground property (Publisher)

Indicates whether the parts of the specified picture that are defined as the transparent color appear transparent. Read/write.

Syntax

expression.TransparentBackground

expression A variable that represents a PictureFormat object.

Return value

MsoTriState

Remarks

The TransparentBackground property value can be one of the MsoTriState constants declared in the Microsoft Office type library and shown in the following table.

Constant Description
msoFalse Parts of the picture whose color is the transparency color don't appear transparent.
msoTriStateMixed Return value only, indicating a combination of msoTrue and msoFalse for the specified objects.
msoTriStateToggle A set value that switches between msoTrue and msoFalse.
msoTrue Parts of the picture whose color is the transparency color appear transparent.

Use the TransparencyColor property to set the transparent color.

This property applies only to bitmaps.

If you want to be able to see through the transparent parts of the picture all the way to the objects behind the picture, you must set the Visible property of the picture's FillFormat object to mso False. If your picture has a transparent color and the Visible property of the picture's FillFormat object is set to msoTrue, the picture's fill is visible through the transparent color, but objects behind the picture are obscured.

Example

This example sets the color blue as the transparent color for shape one in the active publication. For the example to work, shape one must be a bitmap.

With ActiveDocument.Pages(1).Shapes(1) 
 
 With .PictureFormat 
 .TransparentBackground = msoTrue 
 ' RGB(0, 0, 255) is the color blue. 
 .TransparencyColor = RGB(0, 0, 255) 
 End With 
 
 .Fill.Visible = False 
 
End With 

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.