ITextDocument.SaveCopy Method

Definition

Overloads

SaveCopy(String, Boolean)

Saves the contents of the TextBuffer to the given filePath.

SaveCopy(String, Boolean, Boolean)

Saves the contents of the TextBuffer to the given filePath.

SaveCopy(String, Boolean)

Saves the contents of the TextBuffer to the given filePath.

C++/CX
public:
 void SaveCopy(Platform::String ^ filePath, bool overwrite);

Parameters

filePath
String

The name of the file.

overwrite
Boolean

true if filePath should be overwritten if it exists, otherwise false.

Exceptions

filePath is null.

An I/O error occurred (including an error caused by attempting to overwrite an existing file when overwrite is false).

An access error occurred during file save.

This object has been disposed.

Remarks

This call does not affect the IsDirty, LastSavedTime, and FilePath properties. The FileActionOccurred event is not raised.

Applies to

Visual Studio SDK 2022 およびその他のバージョン
製品 バージョン
Visual Studio SDK 2015, 2017, 2019, 2022

SaveCopy(String, Boolean, Boolean)

Saves the contents of the TextBuffer to the given filePath.

C++/CX
public:
 void SaveCopy(Platform::String ^ filePath, bool overwrite, bool createFolder);

Parameters

filePath
String

The name of the file.

overwrite
Boolean

true if filePath should be overwritten if it exists, otherwise false.

createFolder
Boolean

true if the folder containing filePath should be created if it does not exist, otherwise false.

Exceptions

filePath is null.

An I/O error occurred (including an error caused by attempting to overwrite an existing file when overwrite is false).

An access error occurred during file save.

This object has been disposed.

Remarks

This call does not affect the IsDirty, LastSavedTime, and FilePath properties. The FileActionOccurred event is not raised.

Applies to

Visual Studio SDK 2022 およびその他のバージョン
製品 バージョン
Visual Studio SDK 2015, 2017, 2019, 2022