How do you get the actual text into sMenu- do you Print it line by line?
Yes - ever since I wrote it initially I've been meaning to put it into a
spreadsheet driven format or something easier to maintain from the code
side, but it's been a back shelf project...
Without overloading you (i hope) with miles of meaningless code, here's a
starter:
'file header
sMenu = "//" & vbCrLf & "// " & sCompany & vbCrLf & "//" & vbCrLf & _
"// " & sDiaTitle & " " & sVersion & " Menu" & vbCrLf & "//
" & sVersion & _
vbCrLf & "//" & vbCrLf & vbCrLf
'title section
sMenu = sMenu & "***MENUGROUP=" & UCase(sCo) & vbCrLf & vbCrLf
'toolbars section
sMenu = sMenu & "***TOOLBARS" & vbCrLf & vbCrLf
'main toolbar
sMenu = sMenu & "**TB_" & UCase(sCo) & vbCrLf & "ID_" & LCase(sCo) & _
" [_Toolbar(""" & sCompany & """, " _
& "_Floating, _Show, 240, 160, 1)]" & vbCrLf
'sButtons is an array populated from some spaghetti code of routines and
bitmap names, etc.
'there are a lot of better ways to do this...
'add buttons
For i = 1 To UBound(sButtons, 2)
sMenu = sMenu & "ID_" & LCase(Part_From_Path(sButtons(3, i))) _
& Space(16 - Len(Part_From_Path(sButtons(3, i))) - 2) _
& "[_" & sButtons(0, i) & "("""
etc, etc
How do you know what menu out of the available menus the user is using?
I don't assume anything - each time this runs it's running from scratch, in
other words it's creating a toolbar from nothing either after uninstalling
and reinstalling my app or for a brand new install. Since the user may have
toolbars loaded from multiple menus, this was the cleanest way I could think
of.
Kevin