Solved

Email Hyperlink from Access to Outlook

Posted on 2013-01-11
4
405 Views
Last Modified: 2013-01-11
In Access 2010 I have a form with a command button which creates an Outlook email.  When you click the button it opens up the email in Outlook and in the body I need a link back to the database.

I cannot get the link to work.  Here is the code I've tried to use.

StrBody = StrBody & "<A href='file://S:/Users/jal.doc'><U>Click Here</U></A>"

Also, just out of curiosity, is there a way to send an email from Access to Outlook which has a link to a specific form?

Can anyone help me with this?

Thanks in advance!
0
Comment
Question by:Senniger1
  • 3
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 38766901
You'll have to take a different approach... SendObject as in your previous questions doesn't give you that type of flexibility.

Try this:

Dim olObj As Object
Dim olMail As Object

strbody = strbody & "<A href='file://S:/Users/jal.doc'><U>Click Here</U></A>"

Set olObj = CreateObject("outlook.application")

Set olMail = olObj.CreateItem(0)
With olMail
    .to = "abc@xyz.com"
    .cc = "123@nnn.com"
    .subject = "Blah"
    .HTMLBody = strbody
    .Display
End With
Set olMail = Nothing
Set olObj = Nothing

Open in new window

0
 
LVL 61

Expert Comment

by:mbizup
ID: 38766935
Also,  for the above code to work you need to make sure that your Outlook options allow HTML emails.   (It wouldn't work at my location, because all of our emails are plain text)
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38766959
<<
Also, just out of curiosity, is there a way to send an email from Access to Outlook which has a link to a specific form?
>>

No... but you can send a link to a database which has an autoExec Macro or startup form which takes the user to that specific form. The link will open the database, and the startup macro or code will take the user to the form (I can't think of anyway to get the user to a specific record on that form, though).
0
 

Author Closing Comment

by:Senniger1
ID: 38767041
Perfect.  Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Outlook Free & Paid Tools
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now