Hi,
i have a word document, containing a template for a list. This document is loaded and then i extract each line of the list. With this i want to be able to take one line (not depending on with list level) and add it to a document.
My aim is to build any list, with cray structures, defined in the template.
This is my start:
_listLevel = 0;
_listTemplate = new Collection();
using (FileStream templateStream = new FileStream(listTemplate, FileMode.Open,
FileAccess.Read, FileShare.ReadWrite))
{
_partToInsert = new Document(templateStream);
Section section = (Section)_partToInsert.ChildNodes[0];
Body body = (Body)section.ChildNodes[0];
foreach (Paragraph para in body.ChildNodes)
{
_listTemplate.Add(para);
}
_partToInsert.RemoveAllChildren();
}
_inserter = new DocumentBuilder(_partToInsert);
_inserter.InsertNode(_listTemplate[_listLevel]);
Idea is to load the complete Template into the _partToInsert Document, then extract the
single lines of it. After i got every line, i clear _partToInsert and use
DocumentBuilder.InsertNode() to add the line i need at this point. I repeat this step
for every line i want to add independend of list level.
But when calling InsertNode() method i get the System.ArgumentException telling me that
i cannot insert this node at this location.
Why is this the case and how can i fix it?
Greetings,
Crazkur
PS: i attached the ListTemplate i use