Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

Insert symbol dialog for application

I have a small text editor that I have written using the RTFText control. I would now like to add a button which will show something like the Insert Symbol dialog so a user can graphically insert various symbols without having to use the ALT<nnn> codes.

A small snippet of code would be great.
0
CharlesSHill
Asked:
CharlesSHill
  • 2
1 Solution
 
dr_binksCommented:
create another form with a listbox and add this code:

Private Sub Form_Load()
    Dim I As Integer
   
    For I = 1 To 255
        ' Fills lstSymbols with Symbols
        If I < 10 Then
            lstSymbols.AddItem I & "     -  " & Chr(I)
        ElseIf I < 100 Then
            lstSymbols.AddItem I & "   -  " & Chr(I)
        Else
            lstSymbols.AddItem I & " -  " & Chr(I)
        End If
    Next I
End Sub

Private Sub lstSymbols_DblClick()
    ' Insert selected symbol to rtfText
   formname.rtftextboxname = formname.rtftextboxname & Right(lstSymbols.Text, 1)
End Sub

I hope that helps

~Binks
0
 
gbzhhuCommented:
If you don't mind refrencing word then:
Create word object (keep hidden)
Create word document (invisible)

then

Dim dlg As Dialog
Set dlg = Application.Dialogs(wdDialogInsertSymbol)
dlg.Show
MsgBox ActiveDocument.Paragraphs(1)   'should return the symbol user selected
0
 
CharlesSHillAuthor Commented:
No MSWord on the targe computer
0
 
gbzhhuCommented:
Then AFAIK you will have to create your own interface (form, listbox etc) and populate with symbols as suggested by Binks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now