Book a Demo

Author Topic: Example for GetFormatFromField  (Read 3609 times)

Erwin_Ahlers

  • Guest
Example for GetFormatFromField
« on: August 11, 2008, 06:22:29 pm »
Hello,
I have to get some documentation from some model items (notes property) and insert them into an existing word document. By selecting the item, getting the notes property and use the insertText function of word it works fine. But now I would like to take the format of the documentation also. Since some versions this is available in EA and I shall be able to get the format with the GetFormatFromField method of the repository. The help talks about "after accessing the field" and the function needs the field as Text parameter. How to I "access a field" and what is meant by field? I have the ElementID or diagramID.
Another problem I haven't found a good solution about is then how to get the received RTF format into the word document?
Some help would be very beneficial
Erwin

Erwin_Ahlers

  • Guest
Re: Example for GetFormatFromField
« Reply #1 on: August 11, 2008, 07:01:39 pm »
After searching the whole forum (not the last days/weeks) I found something what I tried then. I guess now I have it.
When inserting format in the documentation special format characters (similar to HTML) are included. So even with a normal get I get the text including formular. To get this now into word I "just" have to parse for these texts and insert the right format statements.
Is my understanding correct? Or is there another, may be simpler way, someone knows?

Erwin

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Example for GetFormatFromField
« Reply #2 on: August 12, 2008, 08:28:53 am »
The notes fields in EA are stored in a HTML like syntax.  So, if you wanted to get the RTF for Element.Notes, you would call Repository.GetFormatFromField("RTF", Element.Notes)