View Single Post
 
Old 12-01-2023, 04:20 PM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Vivka, RobiNew


Check is superfluous. If it wasn't, it isn't declared. If you declare variables, declare them all.


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"
    If .Execute Then
      If aRng.Paragraphs(1).Range.ListFormat.ListType <> 0 Then
        MsgBox "This is a list paragraph"
      Else
        MsgBox "This is not a list paragraph"
      End If
    End If
   End With
  Set aRng = Nothing
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote