I hope someone can offer some assistance. Still struggling with this agent. I need it to open the user mail client and attach the detached doc but I do not know how to do this.
I am getting to getting to “draft message has been created” running debugger and getting no errors, but it is not bringing up the email and attaching the doc.
Here is the code so far. Can someone please show me how to get the email agent to run and attach the document?
I appreciate your time, help and expertise.
Sub draft_msg
Dim ws As New notesuiworkspace
Dim session As New notessession
Dim uidoc As notesuidocument
Dim doc As notesdocument
Dim db2 As notesdatabase
Dim view2 As notesview
Dim doc2 As NotesDocument
Dim subj As Variant
Dim note As NotesRichTextItem
Dim item As NotesItem
Dim username As New NotesName(session.UserName)
strUser = username.canonical
server$ = session.GetEnvironmentString (“MailServer”, True) 'Get user’s home/mail server
mailfile$ = session.GetEnvironmentString (“MailFile”, True) 'Get user’s mail file name
Set db2 = session.getdatabase (server$,mailfile$)
’ Set view2 = db2.getview (“Drafts”)
Set doc2 = db2.createdocument
Call doc2.replaceItemValue(“Form”,“Memo”)
Call doc2.replaceItemValue(“Subject”,“test”)
Call doc2.save(True,False)
Call s_currentsession.UpdateProcessedDoc( doc_RecordDoc )
Messagebox “A draft message has been created with your selections.”
End Sub