How to: Select Text Programmatically
Use the Document.Selection property to select a text. The following code snippet illustrates how you can select a range of 69 positions starting from the position 216 in the document:
Note
A complete sample project is available at https://github.
Document document = server.Document;
document.LoadDocument("Documents\\Grimm.docx", DocumentFormat.OpenXml);
DocumentPosition myStart = document.CreatePosition(69);
DocumentRange myRange = document.CreateRange(myStart, 216);
document.Selection = myRange;