Solved

Email Hyperlink from Access to Outlook

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
My experience with Windows 10 over a one year period and suggestions for smooth operation
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
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…

760 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

25 Experts available now in Live!

Get 1:1 Help Now