View Single Post
 
Old 02-01-2021, 10:24 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

Yes, for some reason, the imported paragraph marks are coming up as double characters (probably a vbCrLf rather than a vbCr).

I've altered the code so it deals with that
Code:
Sub GetUsedParas()
  Dim sList As String, i As Long, sText As String
  For i = 1 To ActiveDocument.Paragraphs.Count
    sText = Trim(ActiveDocument.Paragraphs(i).Range.Text)
    'Debug.Print Len(sText)
    If Split(sText, vbCr)(0) = "" Then
      sList = sList & "," & i
    End If
  Next i
  MsgBox Mid(sList, 2), vbInformation + vbOKOnly, "Empty Paragraphs List"
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote