Export Attachments to Word
* 
This is available from Codebeamer 9.4.0.
When exporting items to Word, it is also possible to include attachments of the items. When attachments are exported, the user will get a zip package. The attachment files are packed together with the document in a single archive. When opening the document, ensure that you extract the entire package. The file structure of the package looks like the following:
testing - Customer Requirement Specifications
├── attachments
│ ├──€ 22192
│ │ ├── 129144_2007_09_10_miurablueprint.jpg
│ │ ├── 129145_cblogo-xl.png
│‚ │ ├── 129149_cbopen.vbs
│ │ ├── 129150_kern.log
│ │ └── 129151_kern.txt
│ └── 22193
│ │ ├── 129146_egy.bmp
│ │ └── 129147_zizi.pdf
│‚ └── readme.txt
└── testing - Customer Requirement Specifications.docx
The attachments directory contains all attachments from the export. This contains a subdirectory for each item exported named by the exported item's id. The original file names are retained, but the attachment id is added as a prefix. The attachment id is globally unique, so it identifies the file. The .docx file next to the attachments directory is the result docx file: it contains links to the files in the attachments as applicable.
To enable attachment export, the docx template must contain the merge field <<item.attachmentsList>>. This also defines the place where the links and images will be inserted.
There are three different modes for exporting attachments:
1. Expand means the attachment will be inline in the document as an image. The user can specify extensions which will end up in the document as images. The supported file types are gif, png, bmp, jpg, jpeg, txt, log, and pdf.
If no extensions are specified, then all supported attachments will be expanded.
The maximum size can be defined for inline images.
When expanding PDF files, a thumbnail image is inserted into the document, which shows the first page of the PDF document. This thumbnail is also a link that opens the full document.
PDF thumbnail creation is using GhostScript, which must be installed on the host running Codebeamer. Tested following versions of GhostScript: 9.07, 9.27.
bin folder of GhostScript installation must be added to PATH environment variable
On Windows machines it is needed to restart Codebeamer to make sure that updated PATH variable is being used. Command prompt have to be restarted as well.
2. Embed means the attachment will be available in the embedded package, and the document will contain a link to it. Extensions can be specified in the same way as in the previous mode, but there are no limitations regarding extensions.
If no extension is specified, then all attachments that have not been expanded will be embedded.
If an extension is defined for expand and embed, it will be expanded.
For example,
3. Export
The remaining attachments that are not expanded or embedded will be added to the zip package, but the document will not refer to those attachments.
For technical reasons, if only export is selected and none of the previous options, <<item.attachmentsList>> is still needed in the template. However, in this case, no attachments will be rendered into the document and this merge field will be empty.
The configuration of these options can be done through the docx template. See below:
Here is an example template which contains the configuration for the export of attachments: template-items-export-attachments.docx.
* 
The values inside the parameter table are given inside content control blocks. When editing values, make sure that you enter values inside those controls. Parameters are identified using the name of these content controls.
The result of expanding a txt or log file is shown below. The file name is a link in the header: when you Ctrl + click that link, it will open the full-text file in the Windows' registered appropriate text editor. The text below only shows the first 1000 characters with a ... at the end if the text is shortened. Note, the red warning reminding the user that this is not the full text, only the beginning.
Was this helpful?