PictureFormat.IsGreyScale Property

Publisher Developer Reference

Returns a MsoTriState constant that indicates whether the picture is a greyscale image. Read-only.

Syntax

expression.IsGreyScale

expression   A variable that represents an 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.

Visual Basic for Applications
  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 .<strong>IsGreyScale</strong> = msoCTrue Then
                    
                    Debug.Print .Filename
                    Debug.Print "Page " &amp; pgLoop.PageNumber
                    
                End If
            End With
        
        End If
    
    Next shpLoop
Next pgLoop

End Sub

See Also