There are 2 ways to do this. The first uses the AppendMenu or InsertMenu APIs (If you'd like an example of these, let me know and I will post them). The other method (and the simpler one) treat the menu items just like a control array.
Basically, to use the control array method, you need to create a "template menu item" at design time and make it a control array by making its index = 0. Also, this menu item should have its visible property set to false (this can be tricky since at least one sub menuitem MUST be visible . . . to overcome this, I would put a "label menu" that is just text header such as "Recent Projects). After that is completed, you simply have to load new menu items (with a unique index value) as need and then set its properties. For example . . .
for intRecentProjectIndex = 1 to 5
Load mnuRecentProject(intRecentProjectIndex)
with mnuRecentProject(intRecentProjectIndex)
.Caption = "Recent Project XYZ"
.Visible = True
End with
next intRecentProjectIndex
This is a very simple bit of code . . . if you'd like more detail, just ask, but this should be enough to get you started. Also, if you want more control, there are the APIs that I mentioned (and can demonstrate for you if needed), but they tend to raise other complications.
- Jeff Marler B-)