A family of Microsoft word processing software products for creating web, email, and print documents.
To modify your script to find the second occurrence of "1 EL VENCEDOR", you can adjust the Selection.Find.Execute method to loop through the occurrences until you reach the second one. Here's a modified version of your script:
Dim occurrenceCount As Integer
occurrenceCount = 0
With Selection.Find
.Text = "1 EL VENCEDOR"
.MatchCase = True
.MatchWholeWord = True
.Wrap = wdFindContinue
.Execute
' Loop until the second occurrence is found
Do While .Found
occurrenceCount = occurrenceCount + 1
If occurrenceCount = 2 Then
Exit Do
End If
.Execute
Loop
End With
If occurrenceCount = 2 Then
' The second occurrence is found
strText = Selection.Text
Selection.Collapse Direction:=wdCollapseStart
Selection.MoveRight Unit:=wdCharacter, Count:=1
Else
MsgBox "Second occurrence not found."
End If
In this script, we count the occurrences of "1 EL VENCEDOR" and exit the loop when the second one is found. If the second occurrence is not found, a message box will notify you.
References: