Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SaveAsPicture Method

ShapeRange.SaveAsPicture Method

Office 2007
Saves a range of one or more shapes as a picture file.

Version Information
 Version Added:  Publisher 2007

Syntax

expression.SaveAsPicture(Filename, pbResolution)

expression   A variable that represents a ShapeRange object.

Parameters

NameRequired/OptionalData TypeDescription
FilenameRequiredStringThe path and file name of the new picture file you want to create. The graphics format the picture is saved in is determined by the file name extension (such as .jpg or .gif) you specify.
pbResolutionOptionalPbPictureResolutionThe resolution in which you want the picture to be saved. See Remarks for possible values.

Remarks

Possible values for the pbResolution parameter are declared in the PbPictureResolution enumeration in the Microsoft Office Publisher type library.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the SaveAsPicture method to save all the shapes on the first page of the active publication as a .jpg picture file.

Before running this code, replace filename.jpg with a valid file name and the path to a folder on your computer where you have permission to save files.

Visual Basic for Applications
Public Sub SaveAsPicture_Example()

    Dim pubShapeRange As Publisher.ShapeRange
    Set pubShapeRange = ThisDocument.Pages(1).Shapes.Range

    pubShapeRange.SaveAsPicture "filename.jpg"
    
End Sub



Community Additions

ADD
Show:
© 2015 Microsoft