PDA

View Full Version : How to forward or reply email from lotus notes using VBA/ VB script



nallathambi
09-01-2015, 06:51 AM
Hi ,

I created VB script to send email from lotus notes. But i want to know to how to forward or reply to the email which is already in lotus notes inbox.

As a temporary solution i created below code, there im copying email text and creating new email to same receipents. But it looses the font style. So please let me know if there is an option to reply email without loosing its format.
Set oSession = CreateObject("Notes.NotesSession")
uname = oSession.UserName
Set oMaildb = oSession.GETDATABASE("", uname&".nsf")
If Not oMaildb.IsOpen Then
oMaildb.OPENMAIL
End If
sView="$Inbox"
Set oMailDocs = oMaildb.GETVIEW(sView)
Set oMailNextDoc = oMailDocs.GETNEXTDOCUMENT(oMailDoc)
Set oMailSubject = oMailDoc.GETFIRSTITEM("Subject")
Set oMailBody = oMailDoc.GETFIRSTITEM("Body")
Set MailDoc = oMaildb.CREATEDOCUMENT
Call MailDoc.ReplaceItemValue ( "From","User1")
emailSendTo =
Call MailDoc.ReplaceItemValue("SendTo", emailSendTo)
Set Body = MailDoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT(oMailBody.text)