Error adding subdocuments to a maindocument

Dec 8, 2009 at 8:33 AM

Hi Cathal,

When I add a second subdocument (SubDocument_2) to a main document I get a duplicate key.

I use the following code

<font size="2" color="#008080"><font size="2" color="#008080">


</font></font><font size="2" color="#008080">



DocX_Document_Main = null;

DocX DocX_Document_Sub = null;

<font size="2">

DocX_Document_Main =





I get the following error

Er is al een item met dezelfde sleutel toegevoegd(duplicate key).:    bij System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)

   bij System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

   bij System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)

   bij System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)

   bij Novacode.DocX.RebuildCustomProperties(DocX document)

   bij Novacode.DocX.InsertDocument(DocX document)

Do you have any idea how to solve this issue. 

<font size="2">


Johan Laagland