![]() |
|
|
|
#1
|
|||
|
|||
|
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
|
|
#2
|
|||
|
|||
|
Yes, Greg, you are right! Thank you for your correction!
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find longest paragraph in Word document | keimba | Word VBA | 2 | 09-11-2019 03:26 PM |
Find word, Insert Paragraph and bookmark
|
gattaca714 | Word VBA | 2 | 03-24-2017 09:23 PM |
| Getting bold Pargraph | kirkm | Word VBA | 11 | 09-19-2016 05:07 PM |
| Find Word then Highlight Whole Sentence and Paragraph Around it | ChrisOK | Word VBA | 4 | 09-08-2016 10:16 PM |
| Find last word in paragraph and delete it | Dave T | Word VBA | 3 | 05-21-2015 12:40 AM |