Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Symbols on VBA UserForm (HTML symbols)

    There are two symbols, ballot box and ballot box with x, which we want to offer as symbols to be added to a Word document. The symbols are ☐ and ☒. How do I add those to a document using Selection.TypeText? Also, will I be able to use the same sort of thing to add them to a list box in a VBA form?Thanks.

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Using the Wingdings font the character values are 168 & 120 respectively so use Chr(168), etc.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    Thank you. And is it possible to put this symbol into a list box in VBA?

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    The following should work.

    .AddItem = Chr(120) & " " & {text or variable here}

    The only problem I see here is that the font in the ListBox may not have those characters at those positions.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. #5
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    That's why I originally thought that Hex would be more reliable. In my original message, I used the Hex code, but I see it got "translated" to the actual symbols.

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I don't think you can change the font inside a userform's listbox control. Can you use the checkbox control instead?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #7
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    I could put this directly on the Ribbon, but that wouldn't be consistent with our other symbols. I have a non-modal user form which the user can position wherever it's handy, like a floating palette, and it remains open after inserting accented letters, typographic symbols, etc.

  8. #8
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    It is possible to change the font of a list or combo box, but -- of course -- it changes the font for the entire control. The only two Wingding items are these 2 boxes, so the font setting doesn't help me.

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    In Word 2010, I can use ChrW(&Hnnnn) to insert Unicode symbols into a ListBox. See attached. (I got the numbers by scrolling through the Arial Unicode MS character set in the Insert>Symbol dialog.)
    Attached Files Attached Files

  10. #10
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    Thank you! I stupidly used AscW instead of ChrW.

Posting Permissions

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