views:

272

answers:

2

Hi,

How can i copy the contents of one FlowDocument to another FlowDocument below is what i tryed

foreach (var blk in fd1.Blocks)
{
   fd2.Blocks.Add(blk);
}

fd1 is FlowDocument1 and fd2 is FlowDocument2.

But i get the below error.

Collection was modified; enumeration operation may not execute.

Thanks

Arvind

A: 

Try

 fd2.Blocks.Add(blk.Clone());
Jason Harrison
There is no clone mehord in blocks.
Arvind