Book a Demo

Author Topic: Linked document to Document  (Read 4506 times)

royvanmarrewijk

  • EA User
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Linked document to Document
« on: April 06, 2016, 12:00:22 am »
Hi,

For our project we use JScript to collect the information from the model and to plot it into a Word document. Since some of our elements contain linked documents with images I would like to know how I can copy the information from the Linked Document into the Word document. I tried to use the GetLinkedDocument function which returns a string of the content but I don't know how to convert this to readable information / images.

Kind regards,
Roy

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Linked document to Document
« Reply #1 on: April 06, 2016, 12:08:25 am »
Hmm. If you don't have a RTF-to-text converter, you might use EA's Repository.GetFormatFromField (string Format, string Text). This will of course remove all formatting information.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Linked document to Document
« Reply #2 on: April 06, 2016, 02:24:15 am »
Roy,

There are ways to get the RTF into Word.
One of them is to use the clipboard (programmatically) and paste it if you use the Word API
Another method would be to use the openDocument (or was it openXML or something like that) format used by docx files.
This is a lot faster then using the Word API.
There was some kind of method to insert an RTF or HTML fragment into a document structure.

We used the latter a few years ago, but I don't remember the details by heart.

Geert