We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can''t merge multiple DOCs

Hi,

I'd like to merge multiple DOCs. The first DOC to merge will do like expected. But if I try to merge the second, I get this exception:

[NullReferenceException: Objekt not set to an instance of an object.]
Syncfusion.DocIO.DLS.WParagraphStyle.CloneListRelationsTo(WordDocument doc)
Syncfusion.DocIO.DLS.WParagraph.CloneStyleTo(WordDocument doc)
Syncfusion.DocIO.DLS.WParagraph.CloneRelationsTo(WordDocument doc)
Syncfusion.DocIO.DLS.WTextBody.CloneRelationsTo(WordDocument doc)
Syncfusion.DocIO.DLS.WSection.CloneRelationsTo(WordDocument doc)
Syncfusion.DocIO.DLS.EntityCollection.OnInsert(Int32 index, Entity entity)
Syncfusion.DocIO.DLS.EntityCollection.CloneTo(EntityCollection destColl)
Syncfusion.DocIO.DLS.WordDocument.ImportContent(IWordDocument doc, Boolean importStyles)

My source code is taken from your samples. Here it is.

IWordDocument doc = new WordDocument();
doc = CreateFirstMergeDoc();
foreach (IWSection sec in doc.Sections)
{
baseDoc.Sections.Add(sec.Clone());
baseDoc.LastSection.BreakCode = sec.BreakCode;
}
doc = CreateSecondMergeDoc();
foreach (IWSection sec in doc.Sections)
{
baseDoc.Sections.Add(sec.Clone()); <-- here rises the exception
baseDoc.LastSection.BreakCode = sec.BreakCode;
}

I load DOT templates in every Create... method.

What is wrong?

3 Replies

JA Jafrin Syncfusion Team November 6, 2009 09:29 AM UTC

Hi Andreas,

Thank you for using Syncfusion products.

We are not able to reproduce the mentioned issue of “Can't merge multiple documents”.Could you please update us with the your sample document. Could you please find the sample from the below link. Please try running this sample and let us know if this helps.

Sample:
http://files.syncfusion.com/support/DocIO.Web/Forum/91134DocumentMerge/DocumentMerge.zip

Please let us know if you have any questions.

Regards,
Jafrin J


AH Andreas Hirtzel November 11, 2009 02:06 PM UTC

Hi Jafrin,

it works well. Thank you.

Regards, Andreas


JA Jafrin Syncfusion Team November 13, 2009 01:45 PM UTC

Hi Andreas,

Thank you for your update. Please let us know if you have any other new queries.

Regards,
Jafrin J


Loader.
Live Chat Icon For mobile
Up arrow icon