View Single Post
 
Old 02-20-2021, 04:47 AM
SamDsouza SamDsouza is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Aug 2019
Posts: 71
SamDsouza is on a distinguished road
Default

SMehta

Try the following
Code:
Dim aPar As Paragraph, sList As String, i As Long, sText As String, prghCnt As Integer, myArrayParaList As Variant

  For i = 1 To ActiveDocument.Paragraphs.Count
  sText = Trim(Trim(ActiveDocument.Paragraphs(i).Range.Text))
    If Split(sText, vbCr)(0) <> "" Then
          sList = sList & i & ","
           myArrayParaList = Split(sList, ",")
    End If
  Next i
  
cmbParaNos.List = myArrayParaList
Changed the following line myArrayParaList = Array(sList) to myArrayParaList = Split(sList, ",")
This does the trick and you wiil have Para nos in your combobox one below the other.
SamD
Reply With Quote