Domino 9 und frühere Versionen > ND8: Entwicklung

Spaltenbreite in dynamischer Tabelle im Mail-Body

<< < (2/2)

Glombi:
Du musst rtpsStyleArray als Array  ;D übergeben und zwar pro Spalte ein Element. In der Designerhilfe gibts dazu folgendes Beispiel:

This view action creates a basic table of 4 rows and 3 columns, and populates it. The width of each column is fixed at 1.5 inches. The left margin of the table is 1.5 inches.

Sub Click(Source As Button)
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  REM Create document with Body rich text item
  Dim doc As New NotesDocument(db)
  Call doc.ReplaceItemValue("Form", "Main topic")
  Call doc.ReplaceItemValue("Subject", "Table 4 x 3")
  Dim body As New NotesRichTextItem(doc, "Body")
  REM Create table in Body item
  rowCount% = 4
  columnCount% = 3

  Dim styles(1 To 3) As NotesRichTextParagraphStyle
For i% = 1 To 3 Step 1
    Set styles(i%) = session.CreateRichTextParagraphStyle
    styles(i%).LeftMargin = 0
    styles(i%).FirstLineLeftMargin = 0
    styles(i%).RightMargin = RULER_ONE_INCH * 1.5
  Next

  Call body.AppendTable _
  (rowCount%, columnCount%,, RULER_ONE_INCH * 1.5, styles)
  REM Populate table
  Dim rtnav As NotesRichTextNavigator
  Set rtnav = body.CreateNavigator
  Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)
  For iRow% = 1 To 4 Step 1
    For iColumn% = 1 To 3 Step 1
      Call body.BeginInsert(rtnav)
      Call body.AppendText("Row " & iRow% & ", Column " & iColumn%)
      Call body.EndInsert
      Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
    Next
  Next
  REM Save document and refresh view
  Call doc.Save(True, False)
  Dim ws As New NotesUIWorkspace
  Call ws.ViewRefresh
End Sub

v_haderer:
P
 E
  R
   F
    E
      K
       T

 :) :) :) :) :) :)

D A N K E !!!1

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln