ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Layout Class / SaveAsFile Method
A string representing the full path of the output file.
Set to true to overwrite the mapx file if it already exists

In This Topic
    SaveAsFile Method (Layout)
    In This Topic
    Exports a layout to a new layout (.pagx) file. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub SaveAsFile( _
       ByVal fullPathToPagXFile As String, _
       ByVal overwrite As Boolean _
    ) 
    public void SaveAsFile( 
       string fullPathToPagXFile,
       bool overwrite
    )

    Parameters

    fullPathToPagXFile
    A string representing the full path of the output file.
    overwrite
    Set to true to overwrite the mapx file if it already exists
    Exceptions
    ExceptionDescription
    value fullPathToPagXFile cannot be null
    This method must be called within the lambda passed to QueuedTask.Run.
    Remarks
    A copy of the layout's definition is saved to file. A layout file can be imported into another project using the ItemFactory Class. A suffix of .pagx is added if the filename does not have one or has a different suffix. To overwrite an existing file of the same name, set overwrite = true.
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also