C
canbya
Hi! Maybe someone will spot why I loose my extend selection when I try
to block after the second search? Appreciate your help.
' Removes existing contractor data
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
..Text = "Contractors"
..Style = "Heading 2"
..Forward = True
..Execute
If Not .Found Then GoTo SaveClose
End With
With Selection
..MoveRight Unit:=wdCharacter, Count:=2
..ExtendMode = False
..ExtendMode = True
End With '*******works fine here
Selection.Find.ClearFormatting
'Leave notes alone
With Selection.Find
..Text = "NOTE(S):"
..MatchCase = True
..Forward = True
..Execute '***works fine here
End With
If Selection.Find.Found Then GoTo SkipHead2
'check for nect section if note: not found
With Selection
..ExtendMode = False '***does not shut off here
..ExtendMode = True ' does not work
End With
With Selection.Find
..Text = "T"
..Style = "Heading 2"
..Forward = True
..Execute
End With 'loose the extend here
SkipHead2:
With Selection
..HomeKey Unit:=wdLine
..ExtendMode = True
End With
Selection.Delete Unit:=wdCharacter, Count:=1 'deletes the T xwrong
to block after the second search? Appreciate your help.
' Removes existing contractor data
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
..Text = "Contractors"
..Style = "Heading 2"
..Forward = True
..Execute
If Not .Found Then GoTo SaveClose
End With
With Selection
..MoveRight Unit:=wdCharacter, Count:=2
..ExtendMode = False
..ExtendMode = True
End With '*******works fine here
Selection.Find.ClearFormatting
'Leave notes alone
With Selection.Find
..Text = "NOTE(S):"
..MatchCase = True
..Forward = True
..Execute '***works fine here
End With
If Selection.Find.Found Then GoTo SkipHead2
'check for nect section if note: not found
With Selection
..ExtendMode = False '***does not shut off here
..ExtendMode = True ' does not work
End With
With Selection.Find
..Text = "T"
..Style = "Heading 2"
..Forward = True
..Execute
End With 'loose the extend here
SkipHead2:
With Selection
..HomeKey Unit:=wdLine
..ExtendMode = True
End With
Selection.Delete Unit:=wdCharacter, Count:=1 'deletes the T xwrong