MailComposeMemo Question

I have a child document that contains a hot button that when clicked will execute the @command(MailComposeMemo) creating a new blank email. I am also loading the “To:” and “Subject:” field - (see below). When I run this code I get an error message “Cannot Locate Field” but when I click OK the message dissappears and the information is there like I wanted. Why am I getting this error message and is there any way to bypass it ? Thanks.

@Command([MailComposeMemo]);

@Command([EditGotoField] ; “SendTo”);

@Command([EditInsertText]; “John Doe”);

@Command([EditGotoField] ; “Subject”);

@Command([EditInsertText]; “Test Subject”)

Subject: MailComposeMemo Question

What about lotus script?

Sub Click(Source As Button)

On Error Goto ERRTRAP

Dim s As New NotesSession

Dim workspace As New NotesUIWorkspace



Dim db As  NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim item As NotesItem

’ Dim copyto(1 To 2) As String

Set uidoc=workspace.currentdocument

Set doc=uidoc.document

Set db=s.currentdatabase



If uidoc.IsNewDoc Then

	Call uidoc.Save

End If



comm$ = (uidoc.FieldGetText( "Subject" ))

cp$ = Trim(uidoc.FieldGetText( "CompName" ))

fn$ =  Trim(uidoc.FieldGetText( "ContactName" ))

ln$ =  Trim(uidoc.FieldGetText( "ContactName_1" ))



If Trim(comm$) = "" Then

	Msgbox "Please enter the SUBJECT to email"

	Exit Sub

End If



Set item = doc.GetFirstItem( "Subject" )

Set memo = New NotesDocument( db )

Call item.CopyItemToDocument( memo, "Body" )

’ memo.Principal=db.Title

memo.Principal=s.CommonUserName+" ("+db.Title+")"



subj=Trim(fn$ & " " & ln$ & " (" & cp$ &  ")")

’ memo.Subject="Comments for " & subj

memo.Subject=subj



Call memo.Send( False, "yadda yadda")



Messagebox "Notification will be sent to...."

Exit Sub		

ERRTRAP:

Messagebox("Error: " & result.geterrormessage(DB_LASTERROR))

End Sub

Subject: RE: MailComposeMemo Question

Thank you Nancy Drew - you solved a mystery for me.

Subject: MailComposeMemo Question

try:

@Command([EditGotoField] ; “EnterSendTo”);

instead of:

@Command([EditGotoField] ; “SendTo”);

Subject: RE: MailComposeMemo Question

Thanks Paul. That was exactly what I needed !