The major difference between writing API external programs with VB and writing Visual Basic for Applications scripts inside IBM® Rational® Rhapsody® is the availability of a root object, known as the Rational Rhapsody application. External VB programs need to create an application object; Visual Basic for Applications scripts have direct access to the already existing application object.
Whether accessed by VB or Visual Basic for Applications programs, operations of the Application object are identical in function. To the Visual Basic for Applications user, however, it looks like all the methods of the root object are local methods in the Visual Basic for Applications context. For example, traversing the Rational Rhapsody model always starts with accessing the project object. The following example shows a Visual Basic for Applications script that displays the name of the project:
Dim a as Object
Set a = getProject
MsgBox a.name
The method getProject is a function of the root object.