Book a Demo

Author Topic: Render the EA notes format in external formats?  (Read 13163 times)

analia

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Render the EA notes format in external formats
« Reply #15 on: January 23, 2014, 07:08:26 am »
Hi,

we are creating reports through the automation interface with EA 7.5 and we have problems with formated notes.
We are proceeding as follows:

1. We create a WordApplication instance:
   Set WordApp = New Word.Application  

2. We add a template (*.dot):
   WordApp.Documents.Add("template.dot")

3. We save the document as rtf.
   Word.Application.ActiveDocument.SaveAs "TestDocument", FileFormat:=6

4. We get the formated element notes into a variable called elementoEA.Notes

5. We set the notes to the Text property (we tried both options a. and b.)

         a. WordApp.ActiveDocument.Bookmarks("\EndOfDoc").Range.Text = elementoEA.Notes
         a. WordApp.ActiveDocument.Bookmarks("\EndOfDoc").Range.Text = Repository.GetFormatFromField("RTF",elementoEA.Notes)


6. We save the document as rtf
    Word.Application.ActiveDocument.SaveAs "TestDocument", FileFormat:=6


When we open the document instead of seeing the formated text we see the format characters.
What are we doing wrong?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Render the EA notes format in external formats
« Reply #16 on: January 23, 2014, 06:41:28 pm »
You'll have to tell Word somehow that the part you are inserting is RTF.
After all RTF is also just text, so Word doesn't automagically know want it to interprete the RTF.

How to do that is more of a Word issue then an EA issue, but I'm sure there's lots of answers on teh internets.

Geert