How to get no. of items appended into rich text field

2755 pts.
Tags:
Lotus Notes
Lotus Script
I want to know the count of total no. of lines of text appended into rich text field i.e  history field.

There is a rich text field to track the history of editing the document.

Every time the document is modified i.e. changing any of the fields the information is appended into the rich text  field.

But it is not tracked that how many items are appended i.e how many times editing had been done in old documents. So, there is a requirement to know in how many documents the no. of editing is more that 100. How this can be done.



Software/Hardware used:
Lotus notes, lotus script, no. of lines appended in rich text field

Answer Wiki

Thanks. We'll let you know when a new response is added.

Thanks guys. It is clear from Edvabnik given script that this can be done as :

considering doc as object of notesdocument
and richtextfield as fieldname of rich text type.

set item =doc.getfirstitem(“richtextfield”)
dim count as variant
count=item.values
msgbox ubound(count)

This really works!

Thanks Edvabnik.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Abushahd
    Hi there ,, The only thing I can mention over here is Lotus Limits http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=%2Fcom.ibm.notes85.help.doc%2Ffram_limits_of_notes_r.html Best Wishes
    4,050 pointsBadges:
    report
  • Edvabnik
    I have created a memo with this agent: Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim rtItem As NotesRichTextItem Dim i% Set doc = s.CurrentDatabase.CreateDocument doc.Subject = "100 Lines in Body" doc.SendTo = s.UserName Doc.Form = "Memo" Set rtItem = doc.CreateRichTextItem("Body") For i = 0 To 99 Call rtItem.AddNewline(1, True) Call rtItem.AppendText(Str(i) + " line in Body is here yxdvyxcvyxcv yxcv yxcv yxcv yx cvyx cv") Next Call doc.Save(True, False) Call doc.Send(False) End Sub Then I could count the number of lines in the body field of this memo with the following agent: Sub Initialize Dim s As New NotesSession Dim doc As NotesDocument Dim rtItem As NotesRichTextItem Dim item As Variant Dim plainText$, vTmp Set doc = s.CurrentDatabase.UnprocessedDocuments.GetFirstDocument If Not doc Is Nothing Then If doc.HasItem("Body") Then Set item = doc.GetFirstItem("Body") If item.Type = 1 Then Set rtItem = doc.GetFirstItem("Body") plainText = rtItem.GetUnformattedText( ) vTmp = Split(plainText, Chr$(10)) Msgbox Str(Ubound(vTmp)) + " strings were found in Body" End If End If End If End Sub Best regards
    75 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following