View Single Post
 
Old 02-01-2021, 09:48 PM
SMehta SMehta is offline Windows 10 Office 2013
Novice
 
Join Date: Jan 2021
Posts: 29
SMehta is on a distinguished road
Default

Quote:
To return the paragraph numbers for empty (or just spaces) paragraphs you could do a loop like this
Code:
Sub GetUsedParas()
  Dim aPar As Paragraph, sList As String, i As Long
  For i = 1 To ActiveDocument.Paragraphs.Count
    If Len(Trim(ActiveDocument.Paragraphs(i).Range.Text)) = 1 Then
      sList = sList & "," & i
    End If
  Next i
  MsgBox Mid(sList, 2), vbInformation + vbOKOnly, "Empty Paragraphs List"
End Sub
Sorry Sir, Msgbox displays only 1 and does not show other Empty Paragraph number when i ran your code although you looped.

I copied the data from Sample.Txt from Notepad to Word Document to check. Removed "Add Space after Paragraph", font is Calibri and size is 11 in word doc.

Will it be possible on which line or Empty Paragraph is positioned ?

So therefore Will i be able to get Following list of Empty Paragraph positioned at
4, 10, 15, 21, 26, 30, 34


SMehta
Thread 1: No: 46342 : Post No22 : TM 13
Reply With Quote