ArcGIS Pro 2.6 API Reference Guide
SaveAsAsync Method

ArcGIS.Desktop.Core Namespace > Project Class : SaveAsAsync Method
The full path to the location where the new project file will be stored, including the file name for the new project file
(optional) A boolean indicating if an existing project file in the specified location with the same name should be overwritten or not. (default value = false)
Saves a copy of the current project file (*.aprx) to the specified location with the specified file name, then opens the new project file
Syntax
public Task<bool> SaveAsAsync( 
   string savePath,
   bool overwrite
)
Public Function SaveAsAsync( _
   ByVal savePath As String, _
   Optional ByVal overwrite As Boolean _
) As Task(Of Boolean)

Parameters

savePath
The full path to the location where the new project file will be stored, including the file name for the new project file
overwrite
(optional) A boolean indicating if an existing project file in the specified location with the same name should be overwritten or not. (default value = false)

Return Value

A Task returning a success result
Remarks

Save As provides a way to save a copy of the current project file (*.aprx) in a new location with a new name. If you save the project to another location, folders will be created accordingly to satisfy the provided folder path if they don't already exist. You must have write access to the location where the new project file is stored.

SaveAsAsync copies the project file only. The new project file continues to reference the same home folder, default geodatabase, and default toolbox as the current project. Paths to these items will be updated appropriately based on the new project file's location. For example, if the current project's default geodatabase is accessed by relative path because the default geodatabase and the project file are stored on the same local disk, such as C:, and you save the new project file to a different local disk drive, such as D:, the new project file will access the same default geodatabase using a fully-qualified path instead of a relative path.

If you use SaveAsAsync to save the new project file in the same location as the current project with a new name, you have effectively renamed the current project. Afterwards, you can delete the copy of the project file with the old name.

After successfully creating the new file, the current project is closed and the new project file is opened. See also

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

Project Class
Project Members