---
id: "P:cAlgo.API.SaveFileDialog.AddExtension"
kind: "property"
type: "T:cAlgo.API.SaveFileDialog"
url: "https://help.ctrader.com/ctrader-algo/references/Dialogs/SaveFileDialog/AddExtension/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# SaveFileDialog.AddExtension

Member of [SaveFileDialog](https://help.ctrader.com/ctrader-algo/references/Dialogs/SaveFileDialog/index.md).

## AddExtension

Gets or sets a value indicating whether a file dialog automatically adds an extension to a file name if the user omits an extension.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No dialog can be shown in the CLI: ShowDialog returns FileDialogResult.None, nothing is written and the dialog settings are only stored.
- Cloud: No dialog can be shown in the cloud: ShowDialog returns FileDialogResult.None, nothing is written and the dialog settings are only stored.

C#:

```csharp
public bool AddExtension {get; set;}
```

Python:

```python
saveFileDialog.AddExtension: bool
```

### Returns

`bool` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
var saveFileDialog = new SaveFileDialog { AddExtension = true, DefaultExt = "txt" };
if (saveFileDialog.ShowDialog() == FileDialogResult.OK)
    saveFileDialog.WriteToFile("Balance: " + Account.Balance);
```

Python:

```python
saveFileDialog = SaveFileDialog()
saveFileDialog.AddExtension = True
saveFileDialog.DefaultExt = "txt"
if saveFileDialog.ShowDialog() == FileDialogResult.OK:
    saveFileDialog.WriteToFile(f"Balance: {api.Account.Balance}")
```

