Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.EditCopyPicture Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Copies the active view as a picture or an OLE object, or exports the active view to a GIF image file.

Syntax

expression. EditCopyPicture( ** Object, ** ForPrinter, ** SelectedRows, ** FromDate, ** ToDate, ** Filename, ** ScaleOption, ** MaxImageHeight, ** MaxImageWidth, ** MeasurementUnits )

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
ObjectOptionalBooleanTrue if the view should be copied as an OLE object. The default value is False.
ForPrinterOptionalLongSpecifies where to copy the view. Can be one of the following PjCopyPictureFor constants: pjScreen, pjPrinter, or pjGIF. If Object is True, ForPrinter is ignored. The default value is pjScreen.
SelectedRowsOptionalBooleanTrue if Project copies only the selected rows. False if the program copies all visible rows.
FromDateOptionalVariantThe beginning of the timescale for the copied picture. If Object is True, FromDate is ignored. If FromDate is specified and ToDate is not, Project will use the last entered date for the end of the timescale. If that would create a negative time span, the program will use the latest timescale date visible in the active view. The default value is the earliest timescale date visible in the active view.
ToDateOptionalVariantThe end of the timescale for the copied picture. If Object is True, ToDate is ignored. If ToDate is specified and FromDate is not, Project will use the last entered date for the beginning of the timescale. If that would create a negative time span, the program will use the earliest timescale date visible in the active view. The default value is the latest timescale date visible in the active view.
FilenameOptionalStringThe file name for the GIF image file. If ForPrinter is pjGIF, FileName is required. If Object is True, or ForPrinter is not pjGIF, FileName is ignored.
ScaleOptionOptionalLongSpecifies how to treat a picture of the active view if it is larger than MaxImageWidth by MaxImageHeight (default 22 inches by 22 inches). The default value is pjCopyPictureKeepRange. Can be one of the PjCopyPictureScaleOption constants.
MaxImageHeightOptionalDoubleSpecifies the maximum height of the picture. The accepted range of MaxImageHeight is 1 to 22 inches (2.54 to 55.88 centimeters). The default value is 22 (inches).
MaxImageWidthOptionalDoubleSpecifies the maximum width of the picture. The accepted range of MaxImageWidth is 1 to 22 inches (2.54 to 55.88 centimeters). The default value is 22 (inches).
MeasurementUnitsOptionalVariantLong. Specifies the units of measurement. The default value is pjInches. Can be one of the PjMeasurementUnits constants.

Return Value

Boolean

Remarks

Using the EditCopyPicture method with no arguments displays the Copy Picture dialog box.

Example

The following example makes a copy of the Gantt Chart view as Test.gif file and saves in the root folder.

Sub Edit_CopyPicture() 
    'Activate the Gantt Chart view 
    ViewApply Name:="&;Gantt Chart" 
    EditCopyPicture ForPrinter:=pjGIF, FileName:="C:\Test.gif" 
End Sub
© 2018 Microsoft