PictureFormat.IsGreyScale property (Publisher)
Returns an MsoTriState constant that indicates whether the picture is a greyscale image. Read-only.
Syntax
expression.IsGreyScale
expression A variable that represents a PictureFormat object.
Return value
MsoTriState
Remarks
The IsGreyScale 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 picture is not a greyscale image. |
msoTriStateMixed | Indicates a combination of msoTrue and msoFalse for the specified shape range. |
msoTrue | The specified picture is a greyscale image. |
Example
The following example returns a list of the greyscale pictures contained in the active publication.
Sub ListGreyScalePictures()
Dim pgLoop As Page
Dim shpLoop As Shape
For Each pgLoop In ActiveDocument.Pages
For Each shpLoop In pgLoop.Shapes
If shpLoop.Type = pbPicture Or shpLoop.Type = pbLinkedPicture Then
With shpLoop.PictureFormat
If .IsEmpty = msoFalse And .IsGreyScale = msoCTrue Then
Debug.Print .Filename
Debug.Print "Page " & pgLoop.PageNumber
End If
End With
End If
Next shpLoop
Next pgLoop
End Sub
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