PictureFormat.Filename Property

Publisher Developer Reference

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.

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

                    Debug.Print "File Name: " &amp; .<strong>Filename</strong>
                    Debug.Print "Horizontal Scaling: " &amp; .HorizontalScale &amp; "%"
                    Debug.Print "Vertical Scaling: " &amp; .VerticalScale &amp; "%"
                    Debug.Print "File size in publication: " &amp; .FileSize &amp; " bytes"

               End If

        End With
    End If
Next shpLoop

Next pgLoop

See Also