Emailing - open Outlook email window from in Access

P

Patrick Graham

Hello,

I have code which allows me to create an email within
Access and then send. However when sent it I am given a
window which says "An outside program is attempting to
send an email using Outlook would you like to give it
permission" then I can choo 1- 10 minutes of permission.

Rather then shocking people wiht this message I figure I
could have Access open an email window from Outlook,
populate that window with the receiver/subject/body. Then
the user could simply click send from within Outlook.
This would avoid that message.

Anyone know where I can find this type of coding?
 
C

Cheryl Fischer

The SendObject method will perform in the way you describe:

DoCmd.SendObject acSendNoObject, , , strEmailAddress, , , strSubject,
strMessage


hth,
 
S

ScottE

Or, you can use the followhyperlink technique, like

Application.FollowHyperlink Address:="mailto:[email protected]?Subject=This is the subject&body=An E-mail from visual basic!", NewWindow:=Tru

If you have less than 40 or so recipients and don't want to automatically add attachments, I think this is better than the sendobject method. However, if the total length of the string you are using is greater than 1010 or so characters, the F/H method will error. It has two advantages over S/O: cancelling the email does not cause an error in Access (trappabpe, but one more thing to deal with), and it does not lock Access and Outlook into "dialog" mode until the email is sent

Hope this helps

- Scot
 

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