Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your inquiry. There should be one small modification in the method and all should work fine. Please see the following code:
private bool InsertBodyContent(Node paleceHolder, Node startNode, ref int nErrorCode, ref string strErrorDesc)
{
m_oOutDoc = paleceHolder.Document;
Node currentNode = startNode;
//Create temporary list
Aspose.Words.Lists.List srcTmpList = null;
Aspose.Words.Lists.List dstTmpList = null;
foreach (Section srcSection in m_oInDoc.Sections)
{
// Loop through all block level nodes (paragraphs and tables) in the body of the section.
foreach (Node srcNode in srcSection.Body)
{
//This creates a clone of the node, suitable for insertion into the destination document.
Node newNode = m_oOutDoc.ImportNode(srcNode, true, ImportFormatMode.KeepSourceFormatting);
if (srcNode.NodeType == NodeType.Paragraph)
{
Paragraph srcTmpPar = (Paragraph)srcNode;
if (srcTmpPar.IsListItem)
{
Paragraph dstTmpPar = (Paragraph)newNode;
if (srcTmpPar.ListFormat.List == srcTmpList)
{
dstTmpPar.ListFormat.List = dstTmpList;
}
else
{
srcTmpList = srcTmpPar.ListFormat.List;
dstTmpList = dstTmpPar.ListFormat.List;
}
}
}
//Insert new node after the reference node.
paleceHolder.ParentNode.InsertBefore(newNode, paleceHolder);
}
}
paleceHolder.Remove();
return true;
}
Best regards.