I'm having hard time doing a simple highlight on my text by using HTML in Lotus Notes with VBA.
I had used the following attributes <span style=background:yellow;mso-highlight:yellow>
and <style="background-color:yellow">
without any success and I'm almost about to give up. Is it possible to do this simple thing on Lotus Notes or not ?
Attached here are my code and a screenshot of the result :
VBA Code
Sub SendLocalExtensionEmail()
Dim nMailBody As String Dim nMailSubject As String Dim nMailRecipient As Variant Dim nMail As Object Dim nSession As Object Dim nDatabase As Object Dim nMime As Object Dim nMailStream As Object Dim nChild As Object Dim nSomeMailBodyText As String Dim amountOfRecipients As Integer
msg_var = "<font face=Arial> <p style=font-size:10pt>" & _
"Dear Sir/ Madam, <br />" & _
"<br />" & _
"MANY LINES OF TEXT" & _
"<font color=red><span style=background:yellow;mso-highlight:yellow>" & _
"Please revert within 5 working days" & _
"</font></span>" & _
"Best Regards, <br />" & _
"</font>"
nSomeMailBodyText = msg_var
nMailRecipient = ""
nMailSubject = "A great email"
Set nSession = CreateObject("Notes.NotesSession")
Set nDatabase = nSession.GetDatabase("", "")
Call nDatabase.OPENMAIL
Set nMail = nDatabase.CreateDocument
nMail.SendTo = "[email protected]"
nMail.Subject = "[email protected]"
nSession.ConvertMIME = False
Set nMime = nMail.CreateMIMEEntity
Set nMailStream = nSession.CreateStream
'vBody containung the text in Html
Call nMailStream.WriteText(nSomeMailBodyText)
Call nMailStream.WriteText("<br>")
'-------------------------------------------------------------------
Set nChild = nMime.CreateChildEntity
Call nChild.SetContentFromText(nMailStream, "text/html;charset=iso-8859-1", ENC_NONE)
Call nMailStream.Close
nSession.ConvertMIME = True
Call nMail.Save(True, True)
'Make mail editable by user
CreateObject("Notes.NotesUIWorkspace").EDITDOCUMENT True, nMail
'Could send it here
End Sub
- And an output of my result:
Help please ! I'm so curious to know what's happening there.