Angie:
That code really doesn't take up much execution time. I don't even think
about it, I just use it like it was a built-in function. However, I think
this will also work without examining all the styles:
On Error Resume Next
objStyle = ActiveDocument.Styles("ribbo")
On Error GoTo 0
If objStyle Is Nothing Then
MsgBox "Style is missing."
Else
MsgBox "Style is present."
End If
You have to set On Error Resume Next because if the style doesn't exist the
objStyle = ActiveDocument.Styles("xxx") statement fails. I THINK On Error
GoTo 0 reestablishes error handling. If you already have an error handler,
then use it instead, writing On Error GoTo [Whatever label you've created for
the handler].
If the objStyle = statement errors out because the style doesn't exist, the
objStyle object will be as it started -- Nothing.
I don't like it, but it should work for you.
Bear