title: How Content Controls are indexed in repeating Section Content Control?
body: <p>I have document with two paragraph: in the first one one Plain text CC and in the second one repeating section CC with one Plain Text CC inside.</p>
  
  <p>I am trying to move all the info from CC's in repeating section to appear in first paragraph CC. So far I have come to this code: </p>
  
  <pre><code> Sub first_paragraph()
  
      Dim x As Integer
      Dim xNames As String
      Dim xEntry As String
  
      xNames = ""
  
      With ActiveDocument.SelectContentControlsByTag("VP_pav")
  
          For x = 1 To .Count
              With .Item(x)
                  If .Tag = "VP_pav" Then
                      xEntry = ActiveDocument.SelectContentControlsByTag("VP_pav").Item(x).Range.Text
                          ' "if" for removing comma before first entry
                           If xNames = "" Then
                              xNames = xEntry + xNames
                              Else
                              xNames = xEntry + ", " + xNames
                              End If
                      End If
                  End With
              Next x
          End With
  
      ActiveDocument.SelectContentControlsByTag("pirm_pas").Item(1).Range.Text = xNames
  
  End Sub
  </code></pre>
  
  <p>Problem that CC generated in repeating section CC (then adding new section) seems to get random item number (I thought that first CC with tag "example" would get item number 1, second CC with the same tag get item number 2 and etc., but it seems it is not the case).</p>
  
  <p>Because newly generated CC gets random item numbers, values in first paragraph CC are out of order.</p>
  
  <p>Is it possible to make newly generated CC to get sequential numbers? How they get item numbers if they are not sequential? Should take some different approach?</p>
  
  <p>I am adding picture to illustrate my situation:</p>
  
  <p><a href="https://i.stack.imgur.com/TEiTR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TEiTR.jpg" alt="enter image description here"></a> </p>
  
  <p><em>P.S. I'm deletting my recently posted question about correct variables order in this situation since I determined that it is (probably) not the problem.</em></p>