Solved

Email Hyperlink from Access to Outlook

Posted on 2013-01-11
4
409 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

751 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