Author Topic: Copying fields with numbering in - numbering fails  (Read 3568 times)

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Copying fields with numbering in - numbering fails
« on: September 22, 2014, 05:11:28 pm »
When I'm using the element.Notes command it copies all the text written in the notes field which is good. However this fails if the text contains numbering.
I got the following description in the notes field of an element:

1. Do work
2. Report work
3. Work done

What I what is to put this in a table in word. So I use the following code:
table.Cell(1, 2).Range.Text = element.Notes;
which inserts the following text into the cell:

<ol>
      <li>Do work</li>
      <li>Report work</li>
      <li>Work done</li>
</ol>

Any suggestions?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Copying fields with numbering in - numbering f
« Reply #1 on: September 22, 2014, 05:55:10 pm »
There are two methods namely GetFormatFromField and GetFieldFromFormat in the repository object.

q.

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: Copying fields with numbering in - numbering f
« Reply #2 on: September 22, 2014, 06:08:06 pm »
They both contain a "string format" parameter which I don't know how to set.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Copying fields with numbering in - numbering f
« Reply #3 on: September 22, 2014, 06:41:40 pm »
You can use getformatfromfield() to get RTF or HTML or TXT format of the notes.
You can then use that to put it into the word document.

(its all explained in the help file, you just have to read it)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Copying fields with numbering in - numbering f
« Reply #4 on: September 22, 2014, 07:54:42 pm »
To make it a bit more clear: supply either "TXT", "HTML" or "RTF" as string parameter for the format.

q.