<div class="meta" robots="noindex">

</div>

SharedMethod

# TextOutputStream.Append

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `TextOutputStream.Open<textoutputstream.open>` as a replacement.

</div>

## Description

Opens the passed file so that text can be appended to existing text.

## Notes

If no file exists at the specified location, one is created. If the file cannot be created or opened for appending, an `IOException</api/exceptions/ioexception>` is raised. The append is done by calling Write or WriteLine. The Append shared method replaces the deprecated FolderItem.AppendToTextFile.

## Sample code

This example appends the text in `TextField1</api/deprecated/textfield>` to the text file that was opened by `FolderItem.ShowOpenFileDialog<folderitem.showopenfiledialog>`:

``` xojo
Dim f As FolderItem = GetOpenFolderItem(FileTypes1.Text)
If f <> Nil Then
  Try
    Dim t As TextOutputStream = TextOutputStream.Append(f)
    t.Write(TextField1.Text)
  Catch e As IOException
    ' handle error
  End Try
End If
```

## Compatibility

All project types on all supported operating systems.
