PictureFormat.FileSize property (Publisher)
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.
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for