I have been trying to Format the fields in a Table to add newlines where they are needed in order for the data in the fileds to align properly. They dont do this when i have a field that spans for more than one line.
The field title are "Title", "Contact", "Summary" and "Cost"
When the summary spans for more than one line the data i pull into the other fields using a document collection dont line up with their summary.
I have been appending newlines to the other fields to compensate for this. The code below sets the fields and varaibles fine but they do not show on my form. There is no data to be viewed when the script has run. The fields are set as richtext and are computed, (when they are editible i get an object variable not set error)
Sub Click(Source As Button)
Dim s As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim docresult As notesdocument
Dim uidocresult As notesuidocument
Dim view As notesview
Set db = s.currentdatabase
Set view = db.getview("Newsletter Lookup Dave")
Set doc = view.getfirstdocument
Dim temptitle
Dim tempcontact As String
Dim tempsum As String
Dim result As Integer
Dim sumlength As Integer
Dim contactdh As String
Dim titledh As String
Dim summarydh As String
Dim Costdh As Integer
Dim tempcost As Integer
Dim workspace As New notesuiworkspace
' declare the varaibles to the current notes session and db and open the view
Dim amendtitle As String
Dim amendcontact As String
Dim amendsummary As String
Dim amendcost As String
Set uidocresult = workspace.CurrentDocument
Set docresult = uidocresult.document
Dim richtitle As notesrichtextitem
Set richtitle = docresult.getfirstitem("titledh")
Dim richcon As New notesrichtextitem(docresult, "contactdh")
Dim richsum As New notesrichtextitem(docresult, "summarydh")
Dim richcost As New notesrichtextitem(docresult, "Costdh")
While Not(doc Is Nothing)
temptitle = doc.dbTitle(0)
Dim contact As New notesname(doc.contact(0))
tempcontact = contact.common
tempsum = doc.Summary(0)
tempcost = doc.Calc1(0)
If (Len(temptitle) >= 30) Then
temptitle = Left(temptitle,30)
End If
If (Len(tempcontact) >=16) Then
tempcontact = Left(tempcontact,16)
End If
If (tempsum = "") Then
Call richtitle.appendtext(temptitle)
Call richtitle.addnewline(1)
Call richcon.appendtext(tempcontact)
Call richcon.addnewline(1)
Call richsum.addnewline(2)
Call richcost.appendtext(Cstr(tempcost))
Call richcost.addnewline(1)
Else
Call richtitle.appendtext(temptitle)
Call richcon.appendtext(tempcontact)
Call richsum.appendtext(tempsum)
Call richcost.appendtext(Cstr(tempcost))
End If
Exit Sub
sumlength = Len(tempsum)
result = sumlength / 57
Select Case Left(result,1)
Case 1
Call richtitle.addnewline(1)
Call richcon.addnewline(1)
Call richsum.addnewline(1)
Call richcost.addnewline(1)
Case 2
Call richtitle.addnewline(2)
Call richcon.addnewline(2)
Call richsum.addnewline(1)
Call richcost.addnewline(2)
Case 3
Call richtitle.addnewline(3)
Call richcon.addnewline(3)
Call richsum.addnewline(1)
Call richcost.addnewline(3)
Case 4
Call richtitle.addnewline(4)
Call richcon.addnewline(4)
Call richsum.addnewline(1)
Call richcost.addnewline(4)
Case 5
Call richtitle.addnewline(5)
Call richcon.addnewline(5)
Call richsum.addnewline(1)
Call richcost.addnewline(5)
Case 6
Call richtitle.addnewline(6)
Call richcon.addnewline(6)
Call richsum.addnewline(1)
Call richcost.addnewline(6)
Case 7
Call richtitle.addnewline(7)
Call richcon.addnewline(7)
Call richsum.addnewline(1)
Call richcost.addnewline(7)
End Select
Call docresult.save (True,False)
Set doc = view.getnextdocument(doc)
Wend
Stop
End Sub
Any help would be great as i am runing out of ideas now
Thanks in advance
Dave

Formating RichText Fields (David J Naylor 11.Dec.02)
. . 