HotSpot Text in a email using Access VBA

Hello everyone,

I have Lotus Notes 6.5 with XP and using Excel VBA.

I am attempting to put a hyperlink into a email programmaticly that will take a user to a place on the web. All other users have Notes installed on their machines. I can get the email sent out without the hyperlink, but I’d like to have the text appear in blue to say “click here” and have the link take the user to Google, for example.

I know I can do this by going through Notes and going to Create - Hotspot - Link Hotspot, but how do I do this via vb/vba code? I’ve tried to fond some code examples on the Domino Designer Help or on the web but I haven’t had much luck.

Here’s what I am currently doing with some modifications:

Public Sub SendEmail(strTo As String, strSubject As String, strBody As String, _

Optional strAttachPath As Boolean, Optional strCC As String, Optional strBBC As String)

Dim session As Object

Dim db As Object

Dim doc As Object

Dim rtitem As Object

Set session = CreateObject("Notes.NotesSession")

Set db = session.GetDatabase("", "")

Call db.OpenMail

Set doc = db.CreateDocument



doc.Form = "Memo"

doc.SendTo = strTo

doc.CopyTo = strCC

doc.BlindCopyTo = strBBC

doc.Subject = strSubject

doc.Body = strBody

'Unused

If strAttachPath Then

    Set rtitem = doc.CreateRichTextItem("Attachment")

    Call rtitem.EMBEDOBJECT(1454, "", "G:\Test2.csv")

    Call rtitem.ADDNEWLINE(1, True)

End If



doc.SaveMessageOnSend = True

Call doc.Send(False)



Set rtitem = Nothing

Set doc = Nothing

Set db = Nothing

Set session = Nothing

End Sub

Subject: HotSpot Text in a email using Access VBA

You can use MIME to compose an email. That way, you can write your links and text using HTML.

Something like this:

Dim body1 As NotesMIMEEntity

	Dim stream As NotesStream

	Set stream = session.CreateStream

	session.ConvertMIME = False ' Do not convert MIME to rich text

	Set body1 = doc.CreateMIMEEntity

	Dim header As NotesMIMEHeader

	Set header = body1.CreateHeader("Subject")

	Call header.SetHeaderVal("Your Subject Here")

	Set header = body1.CreateHeader("SendTo")

	Call header.SetHeaderVal("Your SendTo value here")

            Set header = body1.CreateHeader("CopyTo")

	Call header.SetHeaderVal("CC Here")

	Set header = body1.CreateHeader("BlindCopyTo")

	Call header.SetHeaderVal("BCC Here")

	Call stream.WriteText("Put your HTML here")

	Call body1.SetContentFromText (stream, "text/html;charset=UTF-8", ENC_NONE)  

	Call doc.Send(False)

	session.ConvertMIME = True ' Restore conversion	

Something like that.

Subject: RE: HotSpot Text in a email using Access VBA

OK, but where do I insert my text “Click here”?

Subject: RE: HotSpot Text in a email using Access VBA

In the stream where I mention inserting your HTML.