How to audit log a richtext field?

Hi,I have a richtext field on current UIdoc, I want to make audit log of all fields includes this richtext field.

Basically, when the current uidoc is openning, I get the current richtext item, and compare it with the data after modify it (after querysave).

Anybody knows how to make the richtext item in a temporary location and compare the item after querysave?

I tried to define the

Dim ProbDesc As NotesRichTextItem

on Declaration section of Form,

and on queryOpen, I have this code.

Set ProbDesc = source.Document.GetFirstItem( “ProbDesc” )

However, after I changed the data of richtext field, then on PostSave, I lost the original data of richtext field.

Any idea to keep the original richtext field of data?

Subject: versioning

try using versioning. look it up in designer help.

Subject: Remember: objects are Pass by reference

Even though you declared the ProbDesc in the Declarations of the form, while the variable is kept intact during the lifetime of the UIDoc, the object that it points to (i.e. the actual RTF item on the document open in memory) is being modified when the user edits it. So you’ll always just get what the current (as changed by the user) item is.

Versioning your documents would do it by preserving history of the entire document. Otherwise you’ll need to get tricky, and probably do tmpDoc = db.CreateDocument(), ProbDesc.CopyItemToDocument(…tmpDoc) to actually make a COPY of the data in that item into another document to hold on to it.

You could make a copy into the same document, with a different name, I suppose. But you might want to clean it up when you’re done before saving.