K
Keith G Hicks
I'm cleaning up some code from a previous programmer who liked to put "On
Error Resume Next" in places where he didnt' know how to test things in
lines above code that might crash. For example, there are lines like the
following:
Selection.InsertAfter "krh"
On Error Resume Next
Selection.Range.InsertAutoText
I really want to take otu the "On Error Resume Next" and replace it with a
test to see if the AutoTextEntry exists as follows:
Selection.InsertAfter "krh"
If <autotext entry("krh")> exists Then
Selection.Range.InsertAutoText
End If
But I have no idea how to do that. I know I can use NormalTemplate in some
way but that is a problem in and of itself because we're nto using the
Normal Template all the time. I need to search that and another as well.
Anyway, some specific info on how to do this would be wonderful.
Thanks,
Keith
Error Resume Next" in places where he didnt' know how to test things in
lines above code that might crash. For example, there are lines like the
following:
Selection.InsertAfter "krh"
On Error Resume Next
Selection.Range.InsertAutoText
I really want to take otu the "On Error Resume Next" and replace it with a
test to see if the AutoTextEntry exists as follows:
Selection.InsertAfter "krh"
If <autotext entry("krh")> exists Then
Selection.Range.InsertAutoText
End If
But I have no idea how to do that. I know I can use NormalTemplate in some
way but that is a problem in and of itself because we're nto using the
Normal Template all the time. I need to search that and another as well.
Anyway, some specific info on how to do this would be wonderful.
Thanks,
Keith