D
Designingsally
i m reposting this as a new post so that others may benefit.
i want to know if the macros can check if AND
occurs at the end of the penultimate list
Eg
I have:
* book
*car
*dog,cat,rat and ( check this and at the end of the list if and occurs in
the end it cna ignore)
*mat
if it is possible pls help me out
the code i got is
Dim oRng As Range
Set oRng = ActiveDocument.Lists(ActiveDocument.Lists.Count - 1).Range
If oRng.Find.Execute(FindText:="word") Then
oRng.Select
End If
If, however, you mean cycling through all lists in the document and
selecting a word in the penultimate item in that list, then you can use the
following:
Dim oRng As Range
Dim lLists As Long
For lLists = ActiveDocument.Lists.Count To 1 Step -1
With ActiveDocument.Lists(lLists)
Set oRng = .ListParagraphs(.ListParagraphs.Count - 1).Range
If oRng.Find.Execute(FindText:="word") Then
oRng.Select
End If
End With
Next lLists
End Sub
I believe in Hope.
DesigningSally
i want to know if the macros can check if AND
occurs at the end of the penultimate list
Eg
I have:
* book
*car
*dog,cat,rat and ( check this and at the end of the list if and occurs in
the end it cna ignore)
*mat
if it is possible pls help me out
the code i got is
Dim oRng As Range
Set oRng = ActiveDocument.Lists(ActiveDocument.Lists.Count - 1).Range
If oRng.Find.Execute(FindText:="word") Then
oRng.Select
End If
If, however, you mean cycling through all lists in the document and
selecting a word in the penultimate item in that list, then you can use the
following:
Dim oRng As Range
Dim lLists As Long
For lLists = ActiveDocument.Lists.Count To 1 Step -1
With ActiveDocument.Lists(lLists)
Set oRng = .ListParagraphs(.ListParagraphs.Count - 1).Range
If oRng.Find.Execute(FindText:="word") Then
oRng.Select
End If
End With
Next lLists
End Sub
I believe in Hope.
DesigningSally