ibm Rational Rhapsody 7.5 — Writing VBA macros

Customizations for Rational Rhapsody accessing the project object. The following example shows a VBA script that displays the name of the project: Dim a as Object Set a = getProject MsgBox a.name Note: The method getProject is a function of the root object. Writing VBA macros Rhapsody allows you to program a script (or “macro”) in the Microsoft Visual Basic programming language to perform automated activity. To write a Visual Basic macro for Rational Rhapsody: 1. Launch the VBA IDE in one of the following ways: a. Select View > Toolbars > VBA and then select the first icon from the left to launch the VBA IDE. b. Select Tools > VBA and then select Visual Basic Editor from the popup menu. 2.

Edit the Visual Basic project file, .vba , to implement different macros. Once you are finished editing, exit the VBA IDE and save the Rhapsody project. The VBA project is automatically saved whenever the Rhapsody project is saved. Running and sharing macros Later, you can run a Rhapsody VBA macro from the Macros window or as a helper in the Tools menu. In addition, macros can be shared with other users through the macro exporting and importing process. API methods for a VBA macro Note that helper applications might not close the current document. This means that you should not use the following API methods in a VBA macro that you specify as a helper:

482 User Guide Method Interface Object quit IRPApplication openProject IRPApplication close IRPProject