Multiple styles in a selected range

B

Bear

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
 
J

Jezebel

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

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

Bear

Jezebel:

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

Bear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top