This documentation is archived and is not being maintained.

PictureFormat.ImageFormat Property

Office 2007
Returns a PbImageFormat constant that represents the image format of a picture as determined by Microsoft Windows Graphics Device Interface (GDI+). Read-only.



expression   A variable that represents an PictureFormat object.

Return Value


The ImageFormat property applies to the original picture, rather than the placeholder picture, if there is one.

The ImageFormat property value can be one of the PbImageFormat constants declared in the Microsoft Office Publisher type library.

The ImageFormat property indicates the format of the picture after it has been imported into the Windows environment, rather than its original file format. If the picture's file format is not natively supported by the Windows operating system, the picture is converted to an analogous format that is natively supported. As a result, the pbImageFormatCMYKJPEG, pbImageFormatDIB, pbImageFormatEMF, pbImageFormatGIF, and pbImageFormatPICT constants will rarely, if ever, be returned. Consult the table below for specific file format conversions.

File formatConstant returned
.bmp, .dib, .gif, .pictpbImageFormatPNG
.emf, .eps, .epfspbImageFormatWMF
CMYK .jfif, .jpeg, .jpgpbImageFormatJPEG

Windows GDI+ is the portion of the Microsoft Windows XP operating system and the Microsoft Windows Server 2003 operating system that provides two-dimensional vector graphics, imaging, and typography.


The following example prints a list of the .jpg and .jpeg images present in the active publication.

Visual Basic for Applications
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 .ImageFormat = pbImageFormatJPEG Then
                        Debug.Print .Filename
                    End If
                End If
            End With
        End If
    Next shpLoop
Next pgLoop