PictureFormat.HasAlphaChannel property (Publisher)
Returns an MsoTriState constant indicating whether the specified picture contains an alpha channel. Read-only.
Syntax
expression.HasAlphaChannel
expression A variable that represents a PictureFormat object.
Return value
MsoTriState
Remarks
An alpha channel is a special 8-bit channel used by some image processing software to contain additional data, such as masking or transparency information.
The HasAlphaChannel 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 | The specified picture does not contain an alpha channel. |
msoTriStateMixed | Indicates a combination of msoTrue and msoFalse for the specified shape range. |
msoTrue | The specified picture contains an alpha channel. |
Example
The following example returns whether the first shape on the first page of the active publication contains an alpha channel. If the picture is linked, and the original picture contains an alpha channel, that is also returned. This example assumes that the shape is a picture.
With ActiveDocument.Pages(1).Shapes(1).PictureFormat
If .HasAlphaChannel = msoTrue Then
Debug.Print .Filename
Debug.Print "This picture contains an alpha channel."
If .IsLinked = msoTrue Then
If .OriginalHasAlphaChannel = msoTrue Then
Debug.Print "The linked picture " & _
"also contains an alpha channel."
End If
End If
End If
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.
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