Pick non-saved body text from appointment form

I put a custom button in my appointment form and i’m writing lotuscript code to handle its click event.

I need to get the body text of the appointment, add some text to it, and replace the existing body with the edited one.

To achieve that I’m doing this:

If doc.HasItem(“Body”) Then txt = doc.GetItemValue(“Body”)(0)

Then I manipulate the variable ‘txt’. The problem is that it only returns the body that has already been saved. For instance, if i open an appointment that already has the following body: ‘ABCDE’, and type in some extra text: ‘1234ABCDE’, doc.GetItemValue(“Body”)(0) returns ‘ABCDE’, the ‘1234’ is lost.

I already Call doc.Save(True, False, False) before getting the item value. That doesn’t help.

I inspected all document items, there is no hidden item that holds that information.

Does anybody know how i can retrieve that data using lotus script?

Subject: Pick non-saved body text from appointment form

What I was missing was a call to uiDoc.Refresh, like this:

If uiDoc.Editmode Then Call uiDoc.Refresh(True, True, True)

Subject: Body is a RichText Field, you need to get the data in a different way

Look at the NotesRichTextItem class in the Domino Designer Lotusscript help.

Subject: RE: Body is a RichText Field, you need to get the data in a different way

Using the reichtextitem makes no difference, the results are the same

Subject: Debug output?

Are you running with the debugger turned on? If not, do. What is the debugger telling you?

You may also want to post the important bits of your code here with a pointer to where the process seems to fail; it’s kinda hard to debug a problem you can’t see.