Need help on Agent

Hi,I’m trying to send a lotus form via web:

Here’s my code, and I am getting an error message about my “webdoc”.

Sub Initialize

Dim s As New notessession

Dim db As notesdatabase

Dim memo As notesdocument

Dim webdoc As notesdocument

Set db = s.currentdatabase

Set webdoc = s.documentcontext

Set memo = New notesdocument(db)

Dim item As NotesItem



Set rtitem = New NotesRichTextItem( memo, "Body" )

Call rtitem.appendtext("You have recieved a new PFRC Request")

Call rtitem.appendtext("Please follow the document link below to view this document.")

Call rtitem.AppendDocLink( webdoc, "Document Link" )



memo.form = "Memo"

memo.SendTo = webdoc.Email

memo.Importance = "1"

memo.CopyTo = "pfrc@hsl.jgh.mcgill.ca"

memo.Subject = "New PFRC Request"



Call memo.Send(False)

End Sub

Please need help

thanks

Subject: Need help on Agent

Your code runs fine in my environment, Eric – except that you should declare rtitem as NotesRichTextItem.

Subject: Need help on Agent

Shouldn’t the e-mail line look like this? Remember, all fields are arrays…

memo.SendTo = webdoc.Email(0)

Subject: RE: Need help on Agent

No, because SendTo can have multiple values. If the webdoc.Email field is also multivalue, you can make sure that memo.SendTo contains all values by just setting the entire array.