officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentposition-69ee6da4.md
Returns an integer representation of the DocumentPosition object.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
public int ToInt()
Public Function ToInt As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the ToInt() 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/Notes.cs#L15
//Insert a footnote at the end of the 6th paragraph:
DocumentPosition footnotePosition = document.CreatePosition(document.Paragraphs[5].Range.End.ToInt() - 1);
document.Footnotes.Insert(footnotePosition);
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/NotesActions.cs#L15
//Insert a footnote at the end of the 6th paragraph:
DocumentPosition footnotePosition = document.CreatePosition(document.Paragraphs[5].Range.End.ToInt() - 1);
document.Footnotes.Insert(footnotePosition);
word-document-api-examples/CS/CodeExamples/ContentControlsActions.cs#L23
// Insert a form to enter a name:
var namePosition = document.CreatePosition(document.Paragraphs[0].Range.End.ToInt() - 1);
var nameControl = contentControls.InsertPlainTextControl(namePosition);
{
tokens.Add(CreateToken(ranges[i].Start.ToInt(),ranges[i].End.ToInt(), Color.Red));
}
{
tokens.Add(CreateToken(ranges[i].Start.ToInt(), ranges[i].End.ToInt(), Color.Red));
}
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Notes.vb#L12
'Insert a footnote at the end of the 6th paragraph:
Dim footnotePosition As DevExpress.XtraRichEdit.API.Native.DocumentPosition = document.CreatePosition(document.Paragraphs(CInt((5))).Range.[End].ToInt() - 1)
document.Footnotes.Insert(footnotePosition)
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/NotesActions.vb#L12
'Insert a footnote at the end of the 6th paragraph:
Dim footnotePosition As DocumentPosition = document.CreatePosition(document.Paragraphs(5).Range.End.ToInt() - 1)
document.Footnotes.Insert(footnotePosition)
word-document-api-examples/VB/CodeExamples/NotesActions.vb#L29
' Insert a footnote at the end of the sixth paragraph.
Dim footnotePosition As DevExpress.XtraRichEdit.API.Native.DocumentPosition = document.CreatePosition(document.Paragraphs(CInt((5))).Range.[End].ToInt() - 1)
document.Footnotes.Insert(footnotePosition)
For i As Integer = 0 To ranges.Length - 1
tokens.Add(CreateToken(ranges(i).Start.ToInt(), ranges(i).End.ToInt(), Color.Red))
Next
For i As Integer = 0 To ranges.Length - 1
tokens.Add(CreateToken(ranges(i).Start.ToInt(), ranges(i).End.ToInt(), Color.Red))
Next
See Also