View Single Post
 
Old 02-19-2021, 03:14 AM
SMehta SMehta is offline Windows 10 Office 2013
Novice
 
Join Date: Jan 2021
Posts: 29
SMehta is on a distinguished road
Default Trying to get number of para in Combobox

Hello

Basically i was tryling to upload the all the written paragraph numbers into Combobox
and not the Empty ones

I tried the following code but not able to upload the values in combobox one below the other

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 = Array(sList)
    End If
  Next i
  cmbParaNos.List = myArrayParaList
Now i am unable to have values one below the other
Will appreciate if you could help me in correcting the same

Thank you
SMehta
Reply With Quote