PictureFormat.TransparencyColor property (Word)
Returns or sets the transparent color for the specified picture as a red-green-blue (RGB) value. Read/write Long.
Syntax
expression.TransparencyColor
expression An expression that returns a 'PictureFormat' object.
Remarks
For this property to take effect, the TransparentBackground property must be set to True. Applies to bitmaps only.
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 False. If your picture has a transparent color and the Visible property of the picture's FillFormat object is set to True, the picture's fill will be visible through the transparent color, but objects behind the picture will be obscured.
Example
This example sets the color returned by the RGB function as the transparent color for shape one in the active document. For the example to work, shape one must be a bitmap.
blueScreen = RGB(0, 0, 255)
With ActiveDocument.Shapes(1)
With .PictureFormat
.TransparentBackground = True
.TransparencyColor = blueScreen
End With
.Fill.Visible = False
End With
See also
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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for