AddAtID method

Microsoft Visio Developer Reference

AddAtID method

   Example   

Creates a new object with a specified ID in a collection.

Version added

4.0

Syntax

objRet = object.AddAtID(id)

objRet

The new object added to the collection.

object

Required. An expression that returns an AccelTables, MenuSets, or ToolbarSets collection.

id

Required Long. The window context for the new object.

Remarks

The ID corresponds to a window or context menu. If the collection already contains an object at the specified ID, the AddAtID method returns an error.

Valid IDs are declared by the Visio type library and begin with visUIObjSet. Not all collections include an object for every possible ID. For a list of valid contexts for a particular collection, see the SetID property.