Class RepeatingSectionItem (Word VBA)
The class RepeatingSectionItem represents a repeating section item in a content control. To use a RepeatingSectionItem class variable it first needs to be instantiated, for example
Dim rsi as RepeatingSectionItem
Set rsi = ActiveDocument.Range.ContentControls(1).RepeatingSectionItems(Index:=1)
For Each
Here is an example of processing the RepeatingSectionItem items in a collection.
Dim rsi As RepeatingSectionItem
For Each rsi In ActiveDocument.Range.ContentControls(1).RepeatingSectionItems
Next rsi
Delete
Deletes the specified repeating section item.
ActiveDocument.Range.ContentControls(1).RepeatingSectionItems(1).Delete
InsertItemAfter
Adds a repeating section item after the specified item and returns the new item.
You can call this method on repeating section item content controls only. If the ContentControl.AllowInsertDeleteSection property is set to False, this method will return an error.
Dim rsiInsertItemAfter As RepeatingSectionItem
Set rsiInsertItemAfter = ActiveDocument.Range.ContentControls(1).RepeatingSectionItems(1).InsertItemAfter()
InsertItemBefore
Adds a repeating section item before the specified item and returns the new item.
You can call this method on repeating section item content controls only. If the ContentControl.AllowInsertDeleteSection property is set to False, this method will return an error.
Dim rsiInsertItemBefore As RepeatingSectionItem
Set rsiInsertItemBefore = ActiveDocument.Range.ContentControls(1).RepeatingSectionItems(1).InsertItemBefore()
Range
Returns the range of the specified repeating section item, excluding the start and end tags.
Dim rngRange As Range
Set rngRange = ActiveDocument.Range.ContentControls(1).RepeatingSectionItems(1).Range