I have modified the querysend on a reply message. I am trying to copyall items to a new doc in another db the script runs fine the debugger shows that all the code is doing what is meant to do, however when I open the doc in the mail in db there is no message body…here is my code, what am I missing?
Sub Querysend(Source As Notesuidocument, Continue As Variant)
Dim sess As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase, jobcorDB As NotesDatabase
Dim doc As NotesDocument, memo As NotesDocument
Dim customerJob As Variant, sentBy As Variant, recipients As Variant
Dim subject As String, customerName As String, jobNumber As String, h As String, mailSort As String
' validate form
Set db = sess.CurrentDatabase
Set doc = Source.Document
customerJob = doc.GetItemValue("CustomerJob")
If (customerJob(0) = "To file please select a job here") Then
Continue = False
Exit Sub
End If
' parse customer job to get new job numbers
Forall vi In customerJob
h = Strtoken(vi, " | ", 1)
If (jobNumber <> "") Then jobNumber = jobNumber + ";"
jobNumber = jobNumber + Strtoken(h, ":", 2)
End Forall
'modify subject line
Call source.FieldAppendText("Subject"," [" & jobNumber & "]")
doc.subject = Subject + " [" + jobNumber + "]"
customerName = Trim(Strleft(customerJob(0), "-"))
doc.Customer = customerName
’ compose new memo in jobcor db
Set jobcorDB = New NotesDatabase("domino1/dalinalaw","jobcor2.nsf")
Set memo = New NotesDocument(jobcorDB)
Call doc.CopyAllItems(memo, True)
'memo.body = doc.body
memo.Company = customerName
memo.Form = "Memo"
If (doc.GetItemValue("Principal")(0) = "") Then sentBy = doc.GetItemValue("From") Else sentBy = doc.GetItemValue("Principal")
recipients = Arrayappend(doc.GetItemValue("SendTo"), doc.GetItemValue("CopyTo"))
recipients = Arrayappend(recipients, sentBy)
mailSort = "Internal"
Forall c In recipients
If (Instr(c, "dalinalaw") = 0) Then
mailSort = "Client"
Exit Forall
End If
End Forall
memo.MailSort = mailSort
Call memo.RemoveItem("$REF")
Call memo.Save(True, False)
'update Filed status on current doc
doc.Filed = "Yes"
Call doc.Save(True, False)
'End If
End Sub
The intent is to copy the doc to the mail in db (after sending out the reply of course, basically just filing the email) with all it’s content. I get the document into the mailin db but no message body. PLEASE HELP!!!