Sub Click(Source As Button)
Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Dim session As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim doc As notesdocument, curdoc As notesdocument
Dim dc As notesdocumentcollection
Dim maildoc As notesdocument
Dim Body As NotesRichTextItem
Set uidoc=ws.CurrentDocument
Set curdoc=ws.CurrentDocument.Document
Call curdoc.Save (False,True)
Set db=session.currentdatabase
Set maildoc = New NotesDocument( db )
tmpname=curdoc.SendRptToTesting
tmpname2=curdoc.CopyToTesting
message=curdoc.GlobalComment 'text field
message1=curdoc.Comments 'rich text field
message2="Click this docklink to open complete report=========>>"
maildoc.Form = "Memo"
maildoc.Subject = curdoc.Title
maildoc.SendTo = tmpname
maildoc.CopyTo = tmpname2
curdoc.Sent_H = "Yes"
curdoc.Sent = "Yes"
curdoc.Report_Date = Today
curdoc.ReportTime = Now()
curdoc.Draft = "No"
Set Body=New NotesRichTextItem(maildoc,"Body")
Call Body.AppendText(message)
Call Body.AddNewLine(2)
Call Body.AppendText(message1)
Call Body.AddNewline(2)
Call Body.AppendText(message2)
Call Body.AppendDocLink(curdoc,"Please Click this Link to open the Document")
Call maildoc.Send(True)
Call curdoc.Save(True,False)
Call uidoc.Close
End Sub
|