officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-dot-beginupdatecharacters-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentrange-x29.md
Starts modifying properties of characters that fall within a specified document range.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
CharacterProperties BeginUpdateCharacters(
DocumentRange range
)
Function BeginUpdateCharacters(
range As DocumentRange
) As CharacterProperties
| Name | Type | Description |
|---|---|---|
| range | DocumentRange |
A DocumentRange object specifying the DocumentRange.Start and DocumentRange.End of the text.
|
| Type | Description |
|---|---|
| CharacterProperties |
A CharacterProperties object representing the character formatting of the specified range.
|
Document document = server.Document;
document.BeginUpdate();
document.AppendText("Normal\nFormatted\nNormal");
document.EndUpdate();
DocumentRange range = document.Paragraphs[1].Range;
CharacterProperties cp = document.BeginUpdateCharacters(range);
cp.FontName = "Comic Sans MS";
cp.FontSize = 18;
cp.ForeColor = Color.Blue;
cp.BackColor = Color.Snow;
cp.Underline = UnderlineType.DoubleWave;
cp.UnderlineColor = Color.Red;
document.EndUpdateCharacters(cp);
Dim document As Document = server.Document
document.BeginUpdate()
document.AppendText("Normal" & vbLf & "Formatted" & vbLf & "Normal")
document.EndUpdate()
Dim range As DocumentRange = document.Paragraphs(1).Range
Dim cp As CharacterProperties = document.BeginUpdateCharacters(range)
cp.FontName = "Comic Sans MS"
cp.FontSize = 18
cp.ForeColor = Color.Blue
cp.BackColor = Color.Snow
cp.Underline = UnderlineType.DoubleWave
cp.UnderlineColor = Color.Red
document.EndUpdateCharacters(cp)
The following code snippets (auto-collected from DevExpress Examples) contain references to the BeginUpdateCharacters(DocumentRange) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Formatting.cs#L21
// that sets character formatting for the selected range
CharacterProperties cp = document.BeginUpdateCharacters(range);
cp.FontName = "Comic Sans MS";
word-document-api-examples/CS/CodeExamples/FormattingActions.cs#L37
// Start to modify character formatting of the target range.
CharacterProperties cp = document.BeginUpdateCharacters(range);
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/FormattingActions.cs#L16
DocumentRange range = document.Paragraphs[1].Range;
CharacterProperties cp = document.BeginUpdateCharacters(range);
cp.FontName = "Comic Sans MS";
winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L129
// Apply formatting to the "Active Customers" cell
CharacterProperties properties = document.BeginUpdateCharacters(table[0, 2].ContentRange);
properties.FontName = "Segoe UI";
word-document-api-table-examples/CS/Program.cs#L111
//Apply formatting to the "Active Customers" cell
CharacterProperties properties = document.BeginUpdateCharacters(table[0, 1].ContentRange);
properties.FontName = "Segoe UI";
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Formatting.vb#L19
' that sets character formatting for the selected range
Dim cp As DevExpress.XtraRichEdit.API.Native.CharacterProperties = document.BeginUpdateCharacters(range)
cp.FontName = "Comic Sans MS"
word-document-api-examples/VB/CodeExamples/FormattingActions.vb#L33
' Start to modify character formatting of the target range.
Dim cp As DevExpress.XtraRichEdit.API.Native.CharacterProperties = document.BeginUpdateCharacters(range)
' Specify character formatting options.
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/FormattingActions.vb#L13
Dim range As DocumentRange = document.Paragraphs(1).Range
Dim cp As CharacterProperties = document.BeginUpdateCharacters(range)
cp.FontName = "Comic Sans MS"
winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L105
' Apply formatting to the "Active Customers" cell
Dim properties As CharacterProperties = document.BeginUpdateCharacters(table(0, 2).ContentRange)
properties.FontName = "Segoe UI"
word-document-api-table-examples/VB/Program.vb#L87
'Apply formatting to the "Active Customers" cell
Dim properties As CharacterProperties = document.BeginUpdateCharacters(table(0, 1).ContentRange)
properties.FontName = "Segoe UI"
See Also