Page 1 of 1

How to copy a range of the document?

PostPosted: Tue Aug 23, 2011 9:40 am
by Leslie
Hi,

I need to copy a range within a document. Not just an element with sub-elements (like a paragraph or a run), but a list of elements - for example a range between a bookmark start and a bookmark end. Is there any simple solution, or have to build the list of elements to copy, and then use deep copy for all the elements in the list?

thanks,
Leslie

Re: How to copy a range of the document?

PostPosted: Tue Aug 23, 2011 9:58 am
by jason
You have to do something like:

build the list of elements to copy, and then use deep copy for all the elements in the list


The gotchya is that if your list contains anything which references another part (eg comments, footnotes/endnotes, a sectPr with header/footer, images), you'll want to deal with that.

The MergeDocx paid extension can copy a set of contiguous paragraphs containing those things, and may be something to consider if your requirements are complex. If you are interested in that, please contact me off list.