Skip to main content
All docs
V17.2

How to: Copy and Paste Range

The following code snippet demonstrates how to copy and paste range using Document.Copy and Document.Paste methods.

Document document = server.Document;
document.LoadDocument("Documents\\Grimm.docx", DocumentFormat.OpenXml);
DocumentRange myRange = document.Paragraphs[0].Range;
document.Copy(myRange);
document.Paste(DocumentFormat.PlainText);