I’m trying to export data to an word document. I have a main template to write down common data, beside that I also display a list of items based on another template, both template are using same style (as I clone the second one from the first). My code look like this:
private void ExportWorkItem(Document doc, WorkItemNode win) //doc is main document
WorkItem wi = win.WorkItem;
var workItemTemplate = _workItemTemplate.Clone(); // clone a item document from a template
DocumentBuilder builder = new DocumentBuilder(workItemTemplate);
// Write down data to item document
// Use heading 1 to write item title ()
// Do something else…
///End write item data
// append item document to main document
foreach (Aspose.Words.Section section in workItemTemplate)
Aspose.Words.Section newSection = (Aspose.Words.Section)doc.ImportNode(section, true, ImportFormatMode.KeepSourceFormatting);
//Append content of the src section to last section of dst document
My problem is after append item document to main document, I expect headings I wrote in step () will show in document map (or navigation panel in MS Word 2010), but they don’t. The table of content is display correct, it contains all of them.
I’ve searched around but found no solution, any body know what I need to do?
Thanks so much for any help.