Type mismatch on rich text field

Hi all,

I am seeing the following: i have a form with a rich text field set to computed. I use it to hold HTML code generated on the WebQueryOpen event. In that agent, I call the context.GetFirstItem method and write the HTML using the AppendText method. This worked fine until…

Now on the first AppendText call, a type mismatch error is generated. I can work around it by removing the rich text item and re-create it, but I would like to know what is happening. Any pointers are appreciated.

Joost

Subject: Type mismatch on rich text field

could it be that in some cases that RT field does not get created? You create the doc with a different form/subform or in the backend? Could you check if the field exists and if exists, what type it is? Is it RT field you get?

Subject: RE: Type mismatch on rich text field

Hello Normunds,

The documents are created in the backend. But not the RTI fields. They are only present on the Form. But when I step through the work-around (below), the HasItem method returns true, so it does exist. I might add the type test to see what’s there.

The most surprising part is that it used to work.

My work-around is as follows:

Function GetRTIField(byval name as String, doc as NotesDocument) as NotesRichTextField

If doc.HasItem(name) Then

    Call doc.RemoveItem(name)

End If

Set GetRTIField = New NotesRichTextItem(doc, name)

End Function

Joost