ColorModel Property

Microsoft Publisher Visual Basic

Show All Show All

ColorModel Property

Returns a PbColorModel constant that represents the color model of the picture. Read-only.

PbColorModel can be one of these PbColorModel constants.
PbColorModelCMYK
PbColorModelGreyScale
PbColorModelRGB
PbColorModelUnknown

expression.ColorModel()

expression    Required. An expression that returns a PictureFormat object.

Example

The following example returns a list of the pictures with RGB color mode in the active publication.

    Sub ListRGBPictures()
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 Then
                        If .ColorModel = pbColorModelRGB Then
                            Debug.Print .Filename
                        End If
                    End If
                End With
            
            End If
        
        Next shpLoop
    Next pgLoop

End Sub