Domino Code Fragment

Code Name*
How can you display the text of individual table cells using LotusScript in Notes R4?
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.118.12.101
Description*
How can you display the text of individual table cells using LotusScript in Notes R4?
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Solution:
You can accomplish this task programatically by searching for the tab and line feed

characters that separate the cells of a Notes table. A sample script is included below.

Background Information on the Sample Script:

Explanation: For each cell of the table in the "Body" field of the current document, the
sample script displays a messagebox containing the text of the cell.

Requirements: In order for the sample script to work properly, the document must be saved
before the script is run. In addition, the "Body" field of the document must contain only
the table and no other text.

How to Run the Script: Place the script in the click event of a button on the document
containing the table.

The Sample Script:

Sub Click(Source As Button)

Dim w As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim bodytext As Variant
Dim x As Integer, y As Integer
Dim asciichr As Integer


Set uidoc = w.currentdocument
Set doc = uidoc.document


bodytext = doc.body

y = 1
For x = 1 To Len(bodytext)
asciichr = Asc(Mid(bodytext,x,1))
If asciichr = 9 Or asciichr = 10 Then
cellnumber = cellnumber + 1
Messagebox("Cell " & Str(cellnumber) & " contains """ & Mid(bodytext,y,x-y)) & """"
y = x + 1
End If
Next x


End Sub