PDA

View Full Version : Character code for Bullet



krishnak
01-03-2008, 11:59 AM
Hi All,

I am writing a code for formating a Word document with the following conditions:
1. Remove the spaces or tabs at the beginning of the paragraph.
2. If the paragraph is bulleted (or numbered), retain the bullet (or number), but remove the tab space after the bullet.

The first part is easy. I modify the string of the paragraph text until the first character is not a space or a tab (32 or 9). I may also add other characters (like ! ) later.
For the second part, how do I recognize a bullet by its character code?
In one of the articles of MSDN library (CleanString method), it was mentioned that code 183 represents a bullet, but when I introduce that character code in a string, a space is added. When I run a script to determine the first character of the paragraph text, I get the character code of the first letter of the text bypassing the bullet and the tab space.
Thanks for any suggestions.

- Krishna

TonyJollans
01-03-2008, 12:23 PM
Bullets (and numbers) on bulleted (or numbered) paragraphs are not part of the normal run of a Word document so you need to check the paragraph format.

Any character can be used as a bullet and I guess it depends on the font chr(183) seems to be a very small one.

Andy Pope
01-03-2008, 12:46 PM
Another alternative might be CHR(149) ? which is a bigger one ;)

krishnak
01-03-2008, 02:59 PM
I realized that Bullets are ListParagraphs. I can only Indent or Outdent these bullets. Otherwise changing the tab space between the bullet and the text could not be done.
- Krishna

TonyJollans
01-04-2008, 01:17 AM
It can certainly be awkward but it can be done.