# SaveDocumentResultCallback Function

> Callback function for functions saving document data. (e. g. saveDocument and saveSelection)

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Function
- **Introduced:** 23.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > SaveDocumentResultCallback Function
- **222 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/savedocumentresultcallback/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/savedocumentresultcallback/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/savedocumentresultcallback/llms-full.txt

---

### Description

Callback function for functions saving document data. (e. g. [saveDocument](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/savedocument-method/llms-full.txt) and [saveSelection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/saveselection-method/llms-full.txt))

### Syntax

```javascript
function(<SaveDocumentResult> args)
```

### Examples

The following example demonstrates `SaveDocumentResultCallback` in a practical document-editing workflow. Callback function for functions saving document data. (e. g. saveDocument and saveSelection).

```javascript
function saveDocumentResultCallback(args) {
    console.log("args:", args);
}

TXTextControl.saveSelection(TXTextControl.StreamType.HTMLFormat, saveDocumentResultCallback);
```

---

## Nearby

- **Previous:** [Javascript: SaveDocumentResult.streamType Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/savedocumentresult/streamtype-property/llms-full.txt)
- **Next:** [SaveUserDictionaryCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/saveuserdictionarycallback/llms-full.txt)
