Copy block of rich text

Nov 30, 2016 at 10:13 PM
Hi,
Amazing library, thanks for that code.

I need to copy parts of a text that are I have in a template document to generate another document.

In the template document I have blocks of text, which I would like to use to generate this second document, example:

<<text1>>
Text block 1 with multiple lines, paragraph, bold, italic, among other rich formatting.
<<end>>

<<text2>>
Text block 2 with multiple lines, paragraph, bold, italic, among other rich formatting.
<<end>>

<<text3>>
Text block 3 with multiple lines, paragraph, bold, italic, among other rich formatting.
<<end>>

Using the doc.FindAll(str) function I can find every start and end of the block of code I want to copy, but how could I copy this block of code (with formatting) from the template text to the final document?
What function could I use to copy this rich text?
If I use doc.Text.Substring(start, end) I will only have text without any formatting.

Best Regards