Table of Contents

Method AddRepeatingItem

Namespace
DocWright.Dom.ContentControls
Assembly
DocWright.Dom.dll

AddRepeatingItem(ContentControl?)

Appends a copy of an existing repeating-section item.

public ContentControl AddRepeatingItem(ContentControl? template = null)

Parameters

template ContentControl

The item to copy, or null to copy the last item.

Returns

ContentControl

The new item.

Remarks

The new item is a deep clone of template, which keeps its formatting, its nested controls and its preserved markup. Word builds a new row the same way — from the section's own content — so cloning is both the simplest implementation and the one whose output Word recognizes.

Exceptions

ContentControlEditException

The control is not a repeating section, or it has no item to copy.