Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find the bullet symbol (VBA for Word 97/2000)

    <P ID="edit" class=small>Edited by TroyWells on 15-Dec-01 22:36.</P>OK, I'm getting closer, but I'm not there yet.
    I'm having trouble find the symbol used in a bullet. I want to find it so I can add it to a label.

    I basically want something like this:

    ExistingNumberStyleExample = ChrW(Font:= _
    ExistingNumberFormatFont, CharacterNumber:=ExistingNumberFormat, Unicode _
    :=True)

    But of course that doesn't work. HELP!!
    Thanks!!
    Troy

    Previously I wrote:

    I've tried:

    ExistingListLevelNumber = Selection.Paragraphs(1).Range.ListFormat.ListLevel Number
    MsgBox Asc(Selection.Paragraphs(1).Range.ListFormat.ListT emplate.ListLevels(ExistingListLevelNumber).Number Format)

    But the only output I get is "63". And if I try:

    MsgBox ChrW(63)

    I find that all I have is a "?"

    This happened, for example, when I put the diamond shape bullet on a paragraph.

    Thanks again for all your help!!
    Troy

  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Find the bullet symbol (VBA for Word 97/2000)

    I can't help with the main part of your question, but I can tell you that character 63 is a question mark - that's why you get "?" when you enter it! (To see what I mean, in a normal document, hold down Alt and type 63 on the numerical keypad, then release Alt).

    <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Beryl M


  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find the bullet symbol (VBA for Word 97/2000)

    I guess you nearly got it: Just use AscW instead of Asc.
    (Asc will convert the code of the Unicode bullet to Ascii, and so you get the question mark for most Unicode characters)

    For codes > 32767 (=U+0FFF), for example with all bullets from decorative fonts like "Symbol" or "Wingdings", you'll get negative values (because Word uses a signed integer for the code); if you prefer to use positive codes only, you can use
    &HFFFF& And AscW()
    instead of
    AscW()
    (This produces a long integer, with an "unsigned" positive value)

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

  4. #4
    New Lounger
    Join Date
    Nov 2001
    Location
    Amsterdam
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find the bullet symbol (VBA for Word 97/2000)

    <P ID="edit" class=small>Edited by gwhitfield on 18-Dec-01 05:53.</P>Markup added

    Is this any use?

    <A target="_blank" HREF=http://www.bbsinc.com/symbol.html>http://www.bbsinc.com/symbol.html</A>

    Mark

  5. #5
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find the bullet symbol (VBA for Word 97/2000)

    What do you mean by "&HFFFF& And AscW()"? How do you use the &HFFFF and the AscW together to generate the correct symbol?

    An example of the AscW output I'm getting is -3928.

    I need to be able to reproduce this symbol in a label.

    Thanks!!
    Troy

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find the bullet symbol (VBA for Word 97/2000)

    Hi Troy,

    We're in deep geek territory now ...
    Integers are two bytes long (= 16 bit), Long integers 4 bytes (= 32 bit).
    Whether the integer is positive or negative is determined by the leftmost bit (if it's 1, the number is negative).
    &HFFFF& is a long integer (the "&" at the end enforces this).
    In this number, the right 16 bits are 1, the left 16 are 0.
    "And" has the effect that all bits of the other number come through if the bit is 1, and are 0 if the bit is 0 (that "masks" the left 16 bits).

    For your example -3928:
    <pre>-3928 = &HF0A8 (a "negative" short integer),
    converted to long: &HFFFFF0A8 =
    1111 1111 1111 1111 1111 0000 1010 1000
    AND 0000 0000 0000 0000 1111 1111 1111 1111
    -------------------------------------------------------------------------------
    = 0000 0000 0000 0000 1111 0000 1010 1000
    = &H0000F0A8 = 61608</pre>

    You could also have used ChrW(-3928) to output the character, but I prefer positive values (and sometimes, you *do* need them): ChrW(61608).

    Word uses codes starting at &HF000 for the old decorative fonts like Symbol or Wingdings. With a bit of arithmetic, you see that you can get the old ASCII codes for them by adding 4096: -3928+4096=168.
    So in this special case you could also use Chr(168).

    You still need the font:
    MsgBox Selection.Paragraphs(1).Range.ListFormat.ListTempl ate.ListLevels(ExistingListLevelNumber).Font.Name

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Regards, Klaus

Posting Permissions

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