PictureFormat.FileName property (Publisher)

Returns a String that represents the file name of the specified picture or OLE object. Read-only.

Syntax

expression.FileName

expression A variable that represents a PictureFormat object.

Return value

String

Remarks

For linked pictures and OLE objects, the returned string represents the full path and file name of the picture. For embedded pictures and OLE objects, the returned string represents the file name only.

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 returns selected image properties for each picture in the active publication.

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 
 
 Debug.Print "File Name: " & .FileName 
 Debug.Print "Horizontal Scaling: " & .HorizontalScale & "%" 
 Debug.Print "Vertical Scaling: " & .VerticalScale & "%" 
 Debug.Print "File size in publication: " & .FileSize & " bytes" 
 
 End If 
 
 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.