Hi all,
In VBA, when using the selection.characters(1).style, if there is no style
defined at that location a run time error is generated and the macro ends. Is
there a way to catch this error and prevent the macro from stopping?
I need to do this because I dont know if the location has a style set. There
is no mention in the docs of a returned value from that function. I cant
believe that a function is built under the assumption that it cannot fail.
Can anybody help?
Thank you.

Signature
Gerard Duquette
X.Systems Inc
Word Heretic - 22 Jul 2005 01:42 GMT
G'day Gerard Duquette <GerardDuquette@discussions.microsoft.com>,
On Error is the general purpose error trap.
Also pre-check the range is valid, ie the .end is > than the .start.
Every character should have a style, even if it is just Normal or
Default paragraph font.
Steve Hudson - Word Heretic
steve from wordheretic.com (Email replies require payment)
Without prejudice
Gerard Duquette reckoned:
>Hi all,
>
[quoted text clipped - 8 lines]
>
>Thank you.