I will attach what I have that dose not work. I have a too bar key for this, but it dose not work.
Path to file C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace\Interfaces\Fkeys\RJBP_2.MNU
Next I will attach the VBA file, then is fthere is one the handlers I will add this
Sub ChgFkeyFile()' 12/13/10 - This is to change the F3 to View (Reset or ReDraw)'05/11/11 - Changed Name From ChgFkey3 to ChangeFkey, added more Function Key changes..
Dim startPoint As Point3d Dim point As Point3d, point2 As Point3d Dim lngTemp As Long
Dim modalHandler As New Macro2ModalHandler4 AddModalDialogEventsHandler modalHandler
' The following statement opens modal dialog "Function Keys: ...\interfaces\fkeys\funckey.mnu"
' Start a command CadInputQueue.SendCommand "DIALOG FUNCKEYS "
RemoveModalDialogEventsHandler modalHandler CommandState.StartDefaultCommand
END SUB
Implements IModalDialogEventsPrivate Sub IModalDialogEvents_OnDialogClosed(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult)
End Sub
Private Sub IModalDialogEvents_OnDialogOpened(ByVal DialogBoxName As String, DialogResult As MsdDialogBoxResult)
If DialogBoxName = "Function Keys: ...\interfaces\fkeys\funckey.mnu" Then
' The following statement opens modal dialog "Select Function Key Menu"
CadInputQueue.SendCommand "ATTACH MENU C:\Program Files\Bentley\Workspace\interfaces\fkeys\FunckeyRJB.mnu,FK"
' Remove the following line to let the user close the dialog box. DialogResult = msdDialogBoxResultOK
End If ' Function Keys: ...\interfaces\fkeys\FunckeyRJB.mnu
If DialogBoxName = "Select Function Key Menu" Then
CadInputQueue.SendCommand "MDL COMMAND MGDSHOOK,fileList_setFilterCmd *.mnu"
CadInputQueue.SendCommand "MDL COMMAND MGDSHOOK,fileList_setDirectoryCmd C:\Program Files\Bentley\Workspace\interfaces\fkeys\"
CadInputQueue.SendCommand "MDL COMMAND MGDSHOOK,fileList_setFileNameCmd FunckeyRJB.mnu"
End If ' Select Function Key Menu
PS: Is there a way to find out if you have un-used Macro#ModalHandler# ???
Above is teh failure, I sued the recod macro to build it , but it hangs with the screen open . see bellow.
It's possible I've misinterpreted your question, because I'm not entirely certain what you are asking or what it is that does not work for you.
But, if you want to attach a function key menu using VBA, then the simplest way is to wrap the keyin you recorded in a subroutine. Forget the dialog boxes because they're not needed.
There's some example code to attach a Function Key Menu on our web site. Pay attention to the note about making the change permanent.
Regards, Jon Summers LA Solutions