AppendToRTItem

Have created a script to pull report detail from Test logs. However!

everything looks as if it works as it should, no errors reported. you follow it through on the debugger and it says it’s going through the correct steps:

             'Only add Detail section for "Detailed Reports"

             If repType = "Detailed Report" Then

                   Call rBody.BeginSection(tDoc.GetFirstItem("TestArea").Text+" Detail")

                   foundSection = rtNav.FindLastElement(6)

                   If foundSection = True Then

                         Set rtDetail = tDoc.GetFirstItem("TestAreaDetail")

                         If rtDetail.Type = RICHTEXT Then

                               Call rBody.AppendRTItem(rtDetail)



                         End If

                   End If

                   Call rBody.EndSection

                   Call rBody.AddNewLine(1)

             End If

So, in theory this should create a collapsable section within a richtext item (rBody) on a NotesDoc (rDoc) and add the contents of the TestAreaDetail (RT)Field from the Test Document (tDoc)… Like I say follow the debugger through and it all appears to be working…

However, when you review the completed article you’ll see that most of the Detail has not copied - i.e. blank sections. Either that or the data which has come across is incomplete and starts half way through the field as it

appears on the Test Doc… CONFUSED!!

Any suggestions welcome!!!

Subject: AppendToRTItem

What happens if you REM out the section portion? Just append to the rich text field and see if all the information is appended correctly.

Subject: RE: AppendToRTItem

No change. Doesn’t seem to make any difference whether it’s in a section or not.

Tried all sorts! AppendToRTItem, CopyItem, RenderToRT, praying, lucky rabbits foot, etc.!!

It looks like a problem with the Append method?

Subject: RE: AppendToRTItem

Don’t think so…I’m using the append method reading a text file and it works great!

Here’s a snippet of the code…

Dim body As New NotesRichTextItem(doc, “CTPs”)

buffer$ = stream.ReadText(STMREAD_LINE, EOL_CRLF)

REM Discard lines with only LF + CR

	While buffer$ = Chr(13) & Chr(10) _

	And (Not stream.IsEOS)

		buffer$ = stream.ReadText(STMREAD_LINE)

		sLeft = Left (buffer$, 7)

	Wend

	

	If Checker <> "" Then

		If sLeft = "*** NOT" And Left(buffer$, 24) <> Checker Then

			Goto LetsSave

		End If

	End If

	

	If sLeft = "*** NOT" And doc.CTPTask(0) = "" Then

		doc.CTPTask = buffer$

		Call body.AddNewLine( 1 )

	End If

	

	Call body.AppendText(buffer$)

Subject: RE: AppendToRTItem

Looks good! However, I’m trying to import reports containing screen prints etc. as well as formatted text.

Will keep looking!! Thanks anyhow.

ST

:slight_smile: