Hi All,
I have a Lotus Notes Script code via a Form Button, that composes a mail memo Form and I am appending some text to the Body Field…
It gives me an error on this line If bodyitem.Type = RICHTEXT Then
in the below code
Thanks in advance
ac ac
Here is the Form Action Button Code
Sub emailcalllogCustomer
'This script is used to email the call log form to the Customer.
Dim session As New notessession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim dt1 As New NotesDateTime(Now)
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument
Dim doc2 As NotesDocument
Dim doc3 As NotesUIDocument
Dim doc4 As NotesDocument
Dim maildoc As NotesUIDocument
Dim contview As NotesView
Dim contdoc As NotesDocument
Dim bodyitem As Variant
Set db=session.currentdatabase
Set uidoc = workspace.CurrentDocument
Set doc=uidoc.document
Set contview = db.GetView("(Admin View)")
Set contdoc = contview.getFirstDocument
currentname=doc.cnctemail(0)
If uidoc.IsNewDoc Then
Messagebox _
( "Please save the document before forwarding it.")
Exit Sub
End If
If currentname="" Then
Msgbox "There was no Customer Email listed on the call log form. You will have to type it in the TO field", _
MB_ICONINFORMATION,"Missing Customer email"
End If
Set doc3 = ws.ComposeDocument( contdoc.contServerName(0), contdoc.contDatabasePath(0), "Memo")
Set doc3 = ws.CurrentDocument
SendTo = currentname
Call doc3.FieldSetText("SendTo", currentname)
Call doc3.FieldSetText("EnterSendTo", SendTo)
Call doc3.FieldSetText("Subject", "Re: contact_us " & doc.SpecificProduct(0))
Set doc4 = doc3.Document
Set bodyitem = doc4.GetFirstItem( "Body" )
If bodyitem.Type = RICHTEXT Then
Call bodyItem.AppendText("Dear ")
Call bodyItem.AddNewLine(2)
Call bodyItem.AppendText("Thank You for your email")
Call bodyItem.AddNewLine(2)
Call bodyItem.AppendText(Cstr(doc.InqComments(0)))
Call bodyItem.AddNewLine(2)
Call bodyItem.AppendText(doc.Resolution(0))
Call bodyItem.AddNewLine(2)
Call bodyItem.AppendText("If you have any additional questions please feel free to contact us at 800-631-0174 or visit the website at www.bd.com/vacutainer. ")
Call bodyItem.AddNewLine(4)
Call bodyItem.AppendText("Regards,")
Call bodyItem.AddNewLine(1)
Call bodyItem.AppendText("Technical Specialist")
Call bodyItem.AddNewLine(1)
Call bodyItem.AppendText("Global Technical Services")
Call bodyItem.AddNewLine(1)
Call bodyItem.AppendText("Preanalytical Systems")
'Call doc3.send
'Call maildoc.FieldSetText("SaveOptions","0")
'Call maildoc.close
'doc2.SaveOptions = "0"
'Call maildoc.close
End If