Solved

Email Hyperlink from Access to Outlook

Posted on 2013-01-11
4
412 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…

622 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