View Single Post
 
Old 12-01-2023, 10:00 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 208
RobiNew is on a distinguished road
Default Find a word and then check if its paragraph is a list pargraph or not

I'm tryng to check if a paragraph containg the 'Found' word is a list paragraph or not. Can someone help with the tentative code here below? Thanks!
Code:
Sub ListOrNot()
Dim aRng As Range
Set aRng = ActiveDocument.Range
    With aRng.Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Wrap = wdFindStop
      .Format = False
      .MatchCase = False
      .MatchWildcards = False
      .Text = "Title"
      .Execute
    End With
check = aRng.Find.Found.ListFormat.ListType
MsgBox check
End Sub
Reply With Quote