How to modify the value of fied in a email document by lotusscript

I create a new field dvalue in Memo form and create an agent which will modify the new filed dvalue using the following code

Sub Initialize()

Dim s As New Notessession

Dim doc As Notesdocument

Dim st As String

 'DocumentContext is the in-memory document when the agent triggers

Set doc = s.DocumentContext





doc.~dvalue = "10"

End Sub

But this agent does not work, it can not modify the value of dvalue. Please tell me what’s wrong with the code or operation?

Thanks in advance.

Subject: How to modify the value of fied in a email document by lotusscript

you have to call save method for document

doc.save true, false

this should work. :slight_smile:

Subject: RE: How to modify the value of fied in a email document by lotusscript

Yes, it’s worked, thanks a lot