TextRange.Save Method (Stream, String, Boolean)
Saves the current selection to a specified stream in a specified data format, with the option of preserving custom TextElement objects.
Assembly: PresentationFramework (in PresentationFramework.dll)
Public Sub Save ( stream As Stream, dataFormat As String, preserveTextElements As Boolean )
An empty, writable stream to save the current selection to.
- Type: System.String
When preserveTextElements is false, custom TextElement objects are saved as known TextElement types. For example, suppose you create a custom TextElement called Heading1, which inherits from Paragraph. When you call this method with preserveTextElements set to false, Heading1 is converted to a Paragraph when the TextRange is saved. When you call this method with preserveTextElements set to true, Heading1 is saved without being converted. To preserve custom text elements, dataFormat must be set to DataFormats.Xaml.
Available since 3.0