Rational DOORS DXL automation document: Visual Basic code samples have syntax errors

Technote (troubleshooting)


Problem(Abstract)

The IBM Rational DOORS DXL Reference manual for DOORS 9.x contains a section called "Controlling Rational DOORS from applications that support automation" (at the end of Chapter 23). The Visual Basic code samples in this section have multiple syntax errors.

Symptom

You cannot successfully run the Visual Basic (VB) code samples from the IBM Rational DOORS DXL Reference manual's "Controlling Rational DOORS from applications that support automation" section.


Cause

This issue is a result of APAR PM25011, which is resolved as of IBM Rational DOORS 9.3.0.3.

Resolving the problem

The Visual Basic (VB) code samples in the IBM Rational DOORS DXL Reference manual's "Controlling Rational DOORS from applications that support automation" section can be run from macros in the Microsoft Office products. The versions included in the DXL Reference manual have multiple errors:

  • The continuation character in VB is _ (space followed by an underscore). The VB commands that span multiple lines need to use the continuation character.

  • The runStr sample has multiple quote syntax errors, as well as a DXL syntax error.

  • The lines with DOORS commands cannot span multiple lines, as you cannot use the VB line continuation character inside the DOORS commands.

The following versions of the code samples will work:
  • First example:

    /*
    This is an example of an Excel macro that calls Rational DOORS, logging in as user 'John Smith' with password 'password', and sets the result message for use with oleGetResult.
    */
    Sub testDoors()
    Set DOORSObj = CreateObject("DOORS.Application")
    SendKeys "John Smith" & "{TAB}" & "password" & _
    "{ENTER}", True
    DOORSObj.Result = "Just checking"
    End Sub


    Note that the credentials in the sample should be updated to be valid in your environment.

  • runFile sample:

    Sub testDoors()
    Set DOORSObj = CreateObject("DOORS.Application")
    SendKeys "John Smith" & "{TAB}" & "password" & _
    "{ENTER}", True
    DOORSObj.runFile ("c:\doors\lib\dxl\example\ddbintro.dxl")
    End Sub


    Note that the DOORSObj.runFile line is one long line. The credentials and path in the sample should be updated to be valid in your environment.

  • runStr sample:

    Sub testDoors()
    Set DOORSObj = CreateObject("DOORS.Application")
    SendKeys "John Smith" & "{TAB}" & "password" & _
    "{ENTER}", True
    DOORSObj.runStr ("current = create(""Demo"", ""Demo"", """", 1); Object o = create current Module; o.""Object Heading"" = ""From Excel via OLE""")
    End Sub


    Note that the DOORSObj.runStr line is one long line. The credentials in the sample should be updated to be valid in your environment.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational DOORS
Documentation

Software version:

9.0, 9.1, 9.1.0.2, 9.2, 9.2.0.1, 9.2.0.2, 9.2.0.3, 9.2.0.4, 9.2.0.5, 9.3, 9.3.0.1, 9.3.0.2

Operating system(s):

Windows

Reference #:

1450715

Modified date:

2012-06-19

Translate my page

Machine Translation

Content navigation