Hyperlink in e-mail directing to a specific record

P

Paul

Hi,

I'm using Access 2003

I've got a form with a button inside a record that will trigger the code as
mentioned below. This code will insert a hyperlink to whatever path i put in
there but what I'm trying to accomplish is that the hyperlink will point to a
specific record

As far as the code for sending an e-mail with a hyperlink in it that's no
problem, here's the code I got so far:

Private Sub button_Click()

DoCmd.SetWarnings False
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Dim strHTML As String
Dim strHyperlink As String
Dim strExportDirectory As String
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
strHyperlink = "file:///C:\Windows\"
strHTML = "<HTML><Body>Test Body.<p><p><a Href=" & strHyperlink & "
target=new>Testing Link</a></body></html>"
With objMail
..BodyFormat = olFormatHTML
..HTMLBody = strHTML
..To = "e-mail address"
..Subject = "Some Subject"
..Display
End With
Set olApp = Nothing
Set objMail = Nothing

DoCmd.SetWarnings True
End Sub

Any suggestoins anybody?

Cheers,

Paul
 

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