View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Special characters in shortcut menus

Thanks much Doug!

"Doug Glancy" wrote:

XP,

This is kind of crude but seems to do the job. It creates a shortcut bar
and for the UniCode characters 1 to 65536 it attempts to make them the
caption of the shortcut bar. If setting the character as the caption
doesn't cause an error it prints the char in row i, column 1 of the active
spreadsheet - so make sure your activesheeet is blank when you run this.
Many of the chars don't error but are unprintable. This macro takes a while,
but it shows you what number char your up to in the status bar. (I found
the ChrW function which supports UniCode chars from 1 to 65536, but only on
a Windows machine. If you don't want UniCode chars then just use the Chr
function, and change the upper limit of the for loop to 255.)

Sub test()
Dim cbar As CommandBar
Dim cbarbutton As CommandBarButton
Dim i As Long

Application.ScreenUpdating = False
Set cbar = CommandBars.Add()
With cbar
.Visible = True
.Enabled = True
End With

Set cbarbutton = cbar.Controls.Add
With cbarbutton
.Style = msoButtonIconAndCaption
For i = 1 To 65536
If i Mod 100 = 0 Then
Application.StatusBar = i
End If
On Error Resume Next
.Caption = ChrW(i)
If Err = 0 Then
ActiveSheet.Cells(i, 1) = .Caption
End If
On Error GoTo 0
Next i
End With
Application.StatusBar = False
cbar.Delete
Application.ScreenUpdating = True
End Sub

--
hth,

Doug

"XP" wrote in message
...
I am using Office 2003 on Windows XP.

Does anyone have or know where I can find a listing of special characters
that can appear in a shortcut menu (in the menu item text, not the icon) ?

I am presuming this would be a list of characters that may appear in the
VBE
as the character itself, not a question mark? Or is there a way to make
any
special character appear in a shortcut menu - such as delta - ? If so,
how?

Thanks much for your assistance.