0

シナリオは、RichText フィールドを持つフォームがあることです (それがBodyと呼ばれるとしましょう)。読み取りというボタンと同様に

ドキュメントの作成時に、RichText フィールド本体にはデフォルトの 2x2 テーブルが含まれます。ユーザーはセルに値を入力し、読み取りを押す必要あります。これにより、テーブルから値が読み取られ、配列に挿入されます。

4

1 に答える 1

3

richtext-item-content を読み取るには、ドキュメントを保存する必要があります。

次に、NotesRichtextTable- Class から始めます。次の例は、主にデザイナーのヘルプから取られています (はい、デザイナーに統合されているものですが、ここ IBM にもあります...)

Dim ws as New NotesUIWorkspace
Dim uidoc as NotesUIDocument

Dim doc as NotesDocument
Dim rti As NotesRichTextItem
Dim rtnav As NotesRichTextNavigator
Dim rtt As NotesRichTextTable
Dim rtrange As NotesRichTextRange

Set uidoc = ws.CurrentDocument
Call uidoc.Save() 'otherwise you will not be able to get the contents of the richtextitem

Set doc = uidoc.document
Set rti = doc.GetFirstItem("Body")
Set rtnav = rti.CreateNavigator
If Not rtnav.FindFirstElement(RTELEM_TYPE_TABLE) Then
  Messagebox "Body item does not contain a table,",, _
  "Error"
  Exit Sub
End If
Set rtt = rtnav.GetElement
Set rtrange = rti.CreateRange
Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)
firstFlag = True
For i& = 1 To rtt.RowCount
  For j& = 1 To rtt.ColumnCount
    If Not firstFlag Then
      Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
    Else
      firstFlag = False
    End If
    Call rtrange.SetBegin(rtnav)
    Messagebox rtrange.TextParagraph,, _
    "Row " & i& & _
    ", Column " & j&
  Next
Next
于 2013-07-15T12:33:23.180 に答える