Characters collection. Wht's included?

J

John Wirt

What is included in the characters collection of a range? Is a style a
character? Other non-akphanumeric "characters?"

I have a test document with some blank lines in it (just a paragraph mark).
I've written a simple routine that counts 4 characters in these blank lines.

What gives?

John Wirt
 
P

Peter Hewett

Hi John

The Characters collection includes all Characters in the Range! That
includes, letters, numbers, puctuation, spaces, special characters, new line,
new paragraph, section breaks etc.

It also includes fields results, but if you toggle field codes on for the
range your dealing with it will include the field codes instead.

Check out the Range objects TextRetrievalMode property, it affects whether
field code/field results and hidden text is included.

HTH + Cheers - Peter
 
J

Jezebel

In addition to Peter's answer: no, a style is not a character. There are
some odd-balls that do get included if you have a table. Every cell has at
least two characters in it, even if there's no text.
 

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