View Single Post
 
Old 12-02-2023, 11:41 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Select one instance of the table along with a paragraph above and below that table and then go to the Developer Tab and click on the Repeating Section Content Control button.

You can then use the plus button on the bottom right to add more sections. You can right click to add or remove sections. You can also add a macro to ask for a count and do them all at once.
Code:
Sub RepeatMe()
  Dim aCC As ContentControl, iCount As Integer
  Set aCC = ActiveDocument.SelectContentControlsByTitle("Repeater")(1)
  iCount = InputBox("How many?", , 5)
  With aCC.RepeatingSectionItems
    If iCount > .Count Then
      Do While .Count < iCount
        .Item(.Count).InsertItemAfter
      Loop
    ElseIf .Count > iCount Then
      Do While .Count > iCount
        .Item(.Count).Delete
      Loop
    End If
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote