Export (0) Print
Expand All

PictureFormat.FileSize Property

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

Syntax

expression.FileSize

expression   A variable that represents a PictureFormat object.

Return Value
Long

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.

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 = 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



Community Additions

ADD
Show:
© 2014 Microsoft