Armitage2k
Registered User.
- Local time
- Today, 16:15
- Joined
- Oct 10, 2009
- Messages
- 34
Hello, i have no clue what I am doing 
...alright, since I read that at the "How to talk to a programmer" thread, I think it is a necessary thing to point out right at the beginning. I honestly just started with Access 2 days ago and built a rather easy database, but I ran into a small problem now.
I need some help please concerning sending an email from Access (via Outlook) to an email address saved in the table, BUT with a template message which is saved in an external textfile. Besides, the email shall be opened and not being sent immediately. The email address is pulled from the entry which was open when I clicked the email button.
I found a code example for mass-mailing where a template is used and sent to all entries of a database. However, I am not familiar enough with VBA/Access to convert this to one entry and preview only. http://www.paulsadowski.com/wsh/massmailer.htm
I know now that the template function of the SendObject function is not usable for this matter, thus need a workaround for this somehow please.
Also, whenever I close the email, hence do not want to send it, Access starts complaining that the code was interrupted and wants me to either debug or end the macro.
If someone could point me in the right direction to get this fixed, I would highly appreciate it.
Thank you very much for your time and efforts,
A2k
...alright, since I read that at the "How to talk to a programmer" thread, I think it is a necessary thing to point out right at the beginning. I honestly just started with Access 2 days ago and built a rather easy database, but I ran into a small problem now.
I need some help please concerning sending an email from Access (via Outlook) to an email address saved in the table, BUT with a template message which is saved in an external textfile. Besides, the email shall be opened and not being sent immediately. The email address is pulled from the entry which was open when I clicked the email button.
Code:
Private Sub SendEmail1_Click()
Dim stDocName, stLinkCriteria, Subject, Message, Template As String
stTemplate = "C:\template\EmailMessage.txt"
stSubject = "Warm greetings!"
If IsNull([Email]) Or ([Email]) = "" Then
MsgBox "There is no E-mail address entered for this person!"
Exit Sub
Else
stLinkCriteria = Me![Email]
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , , stSubject, stMessage, True, stTemplate
End If
End Sub
I found a code example for mass-mailing where a template is used and sent to all entries of a database. However, I am not familiar enough with VBA/Access to convert this to one entry and preview only. http://www.paulsadowski.com/wsh/massmailer.htm
I know now that the template function of the SendObject function is not usable for this matter, thus need a workaround for this somehow please.
Also, whenever I close the email, hence do not want to send it, Access starts complaining that the code was interrupted and wants me to either debug or end the macro.
If someone could point me in the right direction to get this fixed, I would highly appreciate it.
Thank you very much for your time and efforts,
A2k