You may start by creating one indexed menuitem with the index 0
next you will create new indexes of that first menuitem.
when the user selects one menuitem there will be a call to
Private Sub menusubitem_Click(Index As Integer)
there you already know the index and can know about the name of the menus...
Example:
create a form with one menu called menuitem
create item inside that menu called menusubitem
insert this code:
________________________
Private Sub Form_Load()
For i = 0 To 6
If i > 0 Then Load MenuSubItem(i) 'this will create a ney item with index i
MenuSubItem(i).Caption = "Item &" & i ' change the caption of the new item
Next i
End Sub
Private Sub MenuSubItem_Click(Index As Integer)
MsgBox ("you have clicked on menuitem " & Index)
End Sub