The following code is doing just about everuthing except that the BODY of the original replay message is not being copied into the new document. This script is running on a querysend of a reply form. The intent is to copy the make a new copy of the reply in a mailin db. It does create the new document and keeps MOST of the subject line but the entire body of the reply is missing. When i check the properties of the newly created document on the mainin db the body is missing. It's basically a method for filing emails and replies. On the memo creation I email the document into the main in db which works fine but emailing a reply DOES NOT work so I've tried to create a new doc with all the items from the source document and it doesn't get the body field from the original reply ....................
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
Dim Body 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
' 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)
'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"
memo.MailSort = mailSort
Call memo.Save(True, False)
'update Filed status on current doc
doc.Filed = "Yes"
Call doc.Save(True, False)