Free Support Forum - aspose.com

Upgraded to 3.3.1 from 2.0... i'm broken

I'm recently working with aspose.word again, having not looked at it since around version 2.0.

I have several document fragments that are mail merge templates. With 2.0, we could iterate through the templates, fill them out and combine them together in a single document. The code was kinda screwy, but it worked:

while (m_docFrag.Sections.Count > 0)

{

Section s = m_docFrag.Sections[0];

m_docFrag.Sections.RemoveAt(0);

p.DocumentMain.Sections.Add(s);

s.PageSetup.SectionStart=SectionStart.Continuous;

}

We added another template, with a table in it, and it broke 2.0, so I installed the 3.3.1 dll. Now, the Aspose excepts with the following message at p.DocumentMain.Sections.Add(s):

"The newChild was created from a different document than the one that created this node."

Sorry if someone has asked about this before; the search functionality for the Aspose.Word support forum is broken, so I couldn't research the problem effectively.

The object model has improved signigicantly in 3.0.

Copying and moving nodes between documents has also improved, but you now need to call Document.ImportNode before you can add a node from another document.

thanks for the tip roman;

can you by any chance point me to a code sample?

I tried the following, but am still getting the same message....

while (m_docFrag.Sections.Count > 0)

{

Section s = m_docFrag.Sections[0];

m_docFrag.Sections.RemoveAt(0);

p.DocumentMain.ImportNode(s,true);

p.DocumentMain.Sections.Add(s);

s.PageSetup.SectionStart=SectionStart.Continuous;

}

A section is a 'node', right? the 'source node' is the one that is being imported?

never mind... found a snippet in a past post....

forum search is still broken though (i found the post by serial search).

i must admit, the new object model makes the code a lot less awkward.

thank you very much....

david

Hi David,

I've been in need of searching the Aspose Forums for a few days now and as you know that feature is currently broken. I was wondering what you meant my "serial search"? Did you just click through looking for similar posts or is a serial search something entirely different and if so how do you do one? Your assistance is greatly appreciated.

Justin

Hi David,

I've been in need of searching the Aspose Forums for a few days now and as you know that feature is currently broken. I was wondering what you meant my "serial search"? Did you just click through looking for similar posts or is a serial search something entirely different and if so how do you do one? Your assistance is greatly appreciated.

Justin

P.S. Apparently the email functino in the forum is not working too.