Book a Demo

Author Topic: 1229 document whitespace handling  (Read 5372 times)

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
1229 document whitespace handling
« on: April 12, 2016, 08:52:01 am »
Just a big big ups for the girls and boys who removed all the superfluous white space that was previously inserted in generated documents.
In my mind this is a significant improvement to moving towards being able the create "final" version documents from EA without further editing.
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: 1229 document whitespace handling
« Reply #1 on: April 12, 2016, 09:50:52 am »
+1
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: 1229 document whitespace handling
« Reply #2 on: April 12, 2016, 12:58:21 pm »
Hold your horses, we're not there just yet.

If you have script fragments with rich text you'll notice that the removal of the whitespace is a bit too aggressive.
In 1229 they have removed ALL whitespace from my notes, including the ones that were supposed to stay.

I'm waiting for 1230 to get that fixed as well.

Geert

StefanPears

  • EA User
  • **
  • Posts: 119
  • Karma: +6/-0
  • Unwissenheit schützt vor Erkenntnis nicht
    • View Profile
Re: 1229 document whitespace handling
« Reply #3 on: April 13, 2016, 12:35:57 am »
This is a little help, not a solution. Before starting the VBA in MS-Word remove the three empty lines at the end of the generated document by hand. Don't ask me why. I'm Business Analyst, not Developer ;-)

Sub beautifyEAReport()
    Dim i%, rc As Boolean
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = " ^p"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = False
    End With
    i% = 0
    rc = Selection.Find.Execute(Replace:=wdReplaceAll)
    Do While (rc)
        rc = Selection.Find.Execute(Replace:=wdReplaceAll)
        i% = i% + 1
        If i% > 100 Then MsgBox "Loop Loop Loop" & vbCr & "Empty lines at the end?": Exit Sub
    Loop
   
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^p ^p"
        .Replacement.Text = "^p^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = False
    End With
    i% = 0
    rc = Selection.Find.Execute(Replace:=wdReplaceAll)
    Do While (rc)
        rc = Selection.Find.Execute(Replace:=wdReplaceAll)
        i% = i% + 1
        If i% > 100 Then MsgBox "Loop Loop Loop" & vbCr & "Empty lines at the end?": Exit Sub
    Loop
   
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^p^p^p"
        .Replacement.Text = "^p^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = False
    End With
    i% = 0
    rc = Selection.Find.Execute(Replace:=wdReplaceAll)
    Do While (rc)
        rc = Selection.Find.Execute(Replace:=wdReplaceAll)
        i% = i% + 1
        If i% > 100 Then MsgBox "Loop Loop Loop" & vbCr & "Empty lines at the end?": Exit Sub
    Loop
End Sub