I'm using Word 2000 on XP Pro. My problem arises when I select a range that
contains multiple paragraph styles, and attempt to determine whether or not
all the styles are the same.

Any code like objRange.style results in this error:

Run-time error '91':
Object variable or With block variable not set

The MSDN Library says:

When you return the style for a range that includes more than one style,
only the first character or paragraph style is returned.

Why doesn't this happen? Am I reading this wrong? Is it a Word 2000 thing?

Bear

Re: Multiple styles in a selected range by Jezebel

Jezebel
Mon Jun 26 17:14:25 CDT 2006

Guess you've found a documentation error. Easy enough to deal with ...

If objRange.Style is nothing then
... range contains mixed styles



"Bear" <Bear@discussions.microsoft.com> wrote in message
news:9233EAEB-43EA-451B-83D0-B885F080B2A5@microsoft.com...
> I'm using Word 2000 on XP Pro. My problem arises when I select a range
> that
> contains multiple paragraph styles, and attempt to determine whether or
> not
> all the styles are the same.
>
> Any code like objRange.style results in this error:
>
> Run-time error '91':
> Object variable or With block variable not set
>
> The MSDN Library says:
>
> When you return the style for a range that includes more than one style,
> only the first character or paragraph style is returned.
>
> Why doesn't this happen? Am I reading this wrong? Is it a Word 2000 thing?
>
> Bear



Re: Multiple styles in a selected range by Bear

Bear
Tue Jun 27 08:15:02 CDT 2006

Jezebel:

Thanks so much! That's immediately helpful, and I suspect the insight will
help me in many other ways.

Bear