Inserts a new item into an existing group.

Syntax

rv = Send_Message(Ctrl, "OLE.InsertItem", Group, Item, Caption)

Parameters

ParameterDescription
GroupIndex to an existing group
ItemIndex specifying the insertion point
CaptionThe new group's caption

Remarks

The InsertItem method inserts a new item within a given group. The Group parameter is the index of the group into which the item will be inserted. If you pass an index to an non-existing group, then this method will do nothing. The Item parameter can be an index to an existing item within the group, in which case the item is inserted before the indexed one. If Item is -1 or specifies an index beyond the current number of items, then the new item is added at the bottom of the group. The Caption parameter is the new item's caption. Use any of the Item properties after this call to modify the item as needed.

Example

// Insert a new item at the end of group 1 
Send_Message(@Window:".OLE_SHORTCUTBAR", "OLE.InsertItem", 1, -1, "My New Item")

See Also

RemoveItemInsertGroupClearGroup

  • No labels