StructuredDocumentTag with section break does not import into DOM using .NET

Hi,
I need to insert multiple section (continuos and with multi columns) into StructuredDocumentTag, but i receive an exception “Cannot insert a node of this type at this location.”.

I tried the solution manually with Word 2016 and it is possible:
image.png (30.6 KB)

There is a solution?

Thanks

@davidepedrocca

Thanks for your inquiry. As per Aspose.Words’ document model, only sections can be inserted into Document node. StructuredDocumentTag can occur in a document in the following places:

  • Block-level - Among paragraphs and tables, as a child of a Body, HeaderFooter, Comment, Footnote or a Shape node.
  • Row-level - Among rows in a table, as a child of a Table node.
  • Cell-level - Among cells in a table row, as a child of a Row node.
  • Inline-level - Among inline content inside, as a child of a Paragraph.
  • Nested inside another StructuredDocumentTag.

Unfortunately, this feature is not compatible with our document model. We apologize for your inconvenience.

@davidepedrocca

We have added read only properties for content control that contains the section break in Aspose.Words 20.7. You can find the detail of these properties from here:

Please use following code example to get the title of content controls. Hope this helps you.

var doc = new Document(MyDir + "my_sample.docx");
foreach (StructuredDocumentTagRangeStart tag in doc.GetChildNodes(NodeType.StructuredDocumentTagRangeStart, true))
    Console.WriteLine(tag.Title);

foreach (StructuredDocumentTag tag in doc.GetChildNodes(NodeType.StructuredDocumentTag, true))
    Console.WriteLine(tag.Title);