Export (0) Print
Expand All

PictureFormat.IsGreyScale Property

Office 2007
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.

ConstantDescription
msoFalseThe picture is not a greyscale image.
msoTriStateMixedIndicates a combination of msoTrue and msoFalse for the specified shape range.
msoTrueThe 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 .IsGreyScale = msoCTrue Then
                        
                        Debug.Print .Filename
                        Debug.Print "Page " & pgLoop.PageNumber
                        
                    End If
                End With
            
            End If
        
        Next shpLoop
    Next pgLoop

End Sub



Community Additions

ADD
Show:
© 2014 Microsoft