Lotus Notes email from Excel - formatting body text.

J

Jay Petrulis

How can I format the body of an email message in a Lotus Notes e-mail?

I have instructions for the recipients and would like to boldface a
few items, underline one key phrase, and ensure that the hyperlinks
(static, not the variable part of the mail merge) work automatically
from the receiver's end.

I create the message string in the code without problems. However, it
comes through as plain text and I would either like to convert/paste
it as rich text or manipulate the formatting in some other way. I am
thinking about creating the string and applying it to a worksheet
cell, then formatting it, ccopy then paste into the body, but have not
been successful as of yet.

Any thoughts and/or guidance? The e-mail code is shown. Msg is the
string variable that I need to format.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SendMail(sendlist, Msg As String, SubjLine As String)

Dim arrList

Dim objNotesSession As Object, _
objNotesDatabase As Object, _
objNotesDocument As Object, _
objAttachment As Object, _
objRichText As Object

Const EMBED_ATTACHMENT = 1454

Set objNotesSession = CreateObject("Notes.Notessession")
Set objNotesDatabase = objNotesSession.GetDatabase("", "")
Call objNotesDatabase.OpenMail 'default mail database
If objNotesDatabase.IsOpen = False Then
MsgBox "Cannot connect to Lotus Notes."
Exit Sub
End If
Set objNotesDocument = objNotesDatabase.CreateDocument
Call objNotesDocument.ReplaceItemValue("Form", "Memo")


arrList = Split(sendlist & "," & objNotesSession.CommonUserName,
Chr(44))
ReDim Preserve arrList(LBound(arrList) To UBound(arrList) - 1)

With objNotesDocument
.Subject = SubjLine
.Body = Msg
.SendTo = arrList
.CopyTo = objNotesSession.CommonUserName
.BlindCopyTo = vbNullString
.SaveMessageOnSend = True ' save in Sent folder
.Send (False)
End With
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top