FileSize Property

Microsoft Publisher Visual Basic

FileSize Property

Returns a Long that represents, in bytes, the size of the picture or OLE object as it appears in the specified publication. Read-only.

expression.FileSize()

expression    Required. An expression that returns a PictureFormat object.

Remarks

If the picture or OLE object is linked, use the OriginalFileSize property to determine the size of the linked file.

To determine whether a shape represents a linked picture, use either the Type property of the Shape object, or the IsLinked property of the PictureFormat object.

Example

The following example tests each picture in the active publication, and prints selected image properties for pictures that are linked.

    Dim pgLoop As Page
Dim shpLoop As Shape

For Each pgLoop In ActiveDocument.Pages
    For Each shpLoop In pgLoop.Shapes
        If shpLoop.Type = pbLinkedPicture Then
        
            With shpLoop.PictureFormat
                   
                        Debug.Print "File Name: " & .Filename
                        Debug.Print "Original File Size: " & .OriginalFileSize & " bytes"
                        Debug.Print "File size in publication: " & .FileSize & " bytes"
            End With
        End If
    Next shpLoop
Next pgLoop