Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

Formating RichText Fields
David J Naylor 11.Dec.02 06:47 AM a Web browser
Domino Designer -- LotusScript 4.5.1 OS/2

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)
. . RE: Formating RichText Fields (Rod Whiteley 11.Dec.02)
. . . . RE: Formating RichText Fields (David J Naylor 11.Dec.02)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow