Sdílet prostřednictvím


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.

public:
 void SaveCopy(System::String ^ filePath, bool overwrite);
public:
 void SaveCopy(Platform::String ^ filePath, bool overwrite);
void SaveCopy(std::wstring const & filePath, bool overwrite);
public void SaveCopy (string filePath, bool overwrite);
abstract member SaveCopy : string * bool -> unit
Public Sub SaveCopy (filePath As String, overwrite As Boolean)

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

SaveCopy(String, Boolean, Boolean)

Saves the contents of the TextBuffer to the given filePath.

public:
 void SaveCopy(System::String ^ filePath, bool overwrite, bool createFolder);
public:
 void SaveCopy(Platform::String ^ filePath, bool overwrite, bool createFolder);
void SaveCopy(std::wstring const & filePath, bool overwrite, bool createFolder);
public void SaveCopy (string filePath, bool overwrite, bool createFolder);
abstract member SaveCopy : string * bool * bool -> unit
Public Sub SaveCopy (filePath As String, overwrite As Boolean, createFolder As Boolean)

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