Consulting

Results 1 to 5 of 5

Thread: Character code for Bullet

  1. #1

    Character code for Bullet

    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

  2. #2
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    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.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  3. #3
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    Another alternative might be CHR(149) ? which is a bigger one
    Cheers
    Andy

  4. #4
    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

  5. #5
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    It can certainly be awkward but it can be done.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •