Embed attachments as OLEs in the RPE Word output

This is a guest post by my colleague Subramanya Pilar from the RPE FVT team.

Hyperlinks are a simple and convenient way to attach additional data to a document. There are however scenarios where embedding the content as OLE objects is more useful:

  • the document is self contained, you can transfer the documents with embedded objects to other computers or mail them without breaking any link.
  • you can edit the embedded objects without changing the content of the source.
  • embedded objects can be edited without having to work in a separate window.

Rational Publishing Engine supports creating such documents. The attachment can be of any format supported by Microsoft Word for embedding .xls, .pdf, .doc, .docx are examples of such documents.


The files are downloaded during document generation and the local file path is used as the hyperlink address in RPE. Using a post processing macro iterates the Hyperlinks and inserts the corresponding files as OLE objects. The layout of the document is not changed in the process.


  1. Configure the document specification.
    1. Set variable attachmentsPath to location where the files to be downloaded. By default, it is C:\Attachments
    2. Set RQM Username and Password to qmUser, qmPassWord variables
  2. Copy RQMUrlUtility.jar ( source is https://jazz.net/wiki/bin/view/Main/RQMURLUtility ) and GetAttachment.vbs to the location set in attachmentsPath variable.

The example template, docspec and the utility jar and scripts are available on the DevWorks Wiki here.


Author: Dragos Cojocari

Architect for Rational Publishing Engine

11 thoughts on “Embed attachments as OLEs in the RPE Word output”

  1. Hi Dragos,
    This is great stuff, but do you have similar tools to pull DOORS Next artifact attachments of type “Wrapper Resource”? Specifically, I’m trying to create an OLE attachment for PDF files in DOORS Next.

  2. You can find simplified version of the template along with document specification file and the macro in the archive (https://ibm.box.com/s/0zj4aioybpkuxla8suiprtgz3b7kuh74).
    Note that the execution of commands is disabled by default in RPE 1.3 and later versions. Please enable command execution by setting the com.ibm.rational.rpe.enable_commands property to true in %rpe_home%\studio\rpe-studio.ini and %rpe_home%\launcher\rpe-launcher.ini.

    1. GetAttachment.vbs is not needed with the simplified template.

      1. Configure document specification
      a. Set variable attachmentsPath to location where the files to be downloaded. By default, it is C:\Attachments
      b. Set RQM Username and Password to qmUser, qmPassWord variables
      2. Copy RQMUrlUtility.jar (https://jazz.net/wiki/bin/view/Main/RQMURLUtility) to the location set in attachmentsPath variable.
      3. Generate the document.

    2. Hi Prasaad,
      Thanks for putting very helpful resources . In additon to that, when I change anything in those studio and launcher config files and try to save later on, i get the message “Access is Denied”. I really appreciate your effort to help me.

      1. Please try running Notepad as administrator and then open .ini file through File menu. You should be able to save the changes.
        This is not related to RPE and you can find more solutions/details on MS forums.

  3. Dragos and Subramanya,

    I am generating an RPE template to report on some RQM Test Case Results that were executed with test data. As part of the output, I need to show the values of a couple of variables from the test data that were used to obtain specific results. The REST API for RQM doesn’t provide a way to obtain the variable values used on the steps during test data iteration so I was looking for alternatives. I know how to obtain the URL to the RQM attachment that represents the test data CSV file, I just have not found any way to open the attachment so I can read the data into memory and look up the values based on the test data row used for any particular step result for the test case. Is there anyway to read the contents of a file from a URL (specifically an RQM attachment URL)? My alternative is to have the testers encode the Variable name and value in the step in a fashion that I can parse for it during RPE execution.

    Thank you,
    Jamie Berry.

    1. I do not see an option to show “couple of variables” from test data / csv file. You can however, show all data from csv file by using Include File element.

      1. Thank you for the reply. What I actually need is access to all of the test data in the JavaScript that I write in my template so I can incorporate the data in the output in conjunction with the actual results. Alternatively, I guess I could include the file then write a Word macro to post process the file to fill in “variables” in my output and strip out the data file… I will look at that as an option.

        Thank you,

  4. Hallo, in Doors I have embedded Word tables (I think they are OLE Objects).
    the normal DOORS Word export generates word documents were I can still edit the tables by double click
    But the RPE export converts OLE Obects to Images so I can’t change them….
    How can I tell RPE to export embedded Word tables to editable tables in word?

    1. a found it … i have to uncheck “OLEs to static pictures” in the document specification metadata 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s