View Single Post
 
Old 09-18-2017, 03:03 PM
slaycock slaycock is offline Windows 7 64bit Office 2013
Expert
 
Join Date: Sep 2013
Posts: 255
slaycock is on a distinguished road
Default

A very crude solution

Code:
Sub FindOnLineSix()

Dim myRange As range

Set myRange = ActiveDocument.Content.GoTo(what:=wdLine, which:=wdGoToAbsolute, Count:=6)
    
    If InStr(myRange.Text, "NRCS") Then
        Debug.Print " I found NRC5"
    ElseIf InStr(myRange.Text, "Washington") Then
        Debug.Print "I found Washington"
    ElseIf InStr(myRange.Text, "FSA") Then
        Debug.Print "I found FSA"
    ElseIf InStr(myRange.Text, "St Louis") Then
        Debug.Print "I found St Louis"
    ElseIf InStr(myRange.Text, "Kansas City") Then
        Debug.Print "I found Kansas City"
    Else
        Debug.Print "Boo ho.  Nothing found"
    End If


End Sub
Reply With Quote