hello!
I am an absolute newbie to access but i was able to code my first event procedure all by myself (which makes me quite proud) but now I have come to a commen obstacle of the sendmail function.
i would like to create a button which opens me a blank email with a predefined subject and email from the database entry. well, that i have done and it works great. Now I come accross the problem that I would like to use a template for the message which preferably should be html compatible. However, i read in several forums already that the sendobject function included command Template is only useful for reports which have been exported from access.
So in short, how can I create a new mail with a message which is pulled from a html template? Can it maybe even be somehow implemented into this code?
I found this site where a guy is giving a very clear and understandable example of what i need, only with the difference, that he is doing it for sending mass mails, and i dont know how to port this to a single entry..Code:Dim stDocName, stLinkCriteria, Subject, Message, Template As String stTemplate = "C:\template\EmailMessage.html" 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, , True, stTemplate End If End Sub
Link
Thank you very much for all your help!!!!
A2k
I am newbie in the Hub. I need help from you guys.
I have created macro to send the mail draft along with attachment from mentioned location. I know only small changes in macro. Not a expect.
Please help to resolve the below mentioned qurey in the Macro.
1. My outlook format is HTML. when i run the macro it automatically change plain text and not included my signature. I need HTML format and signature in my query.
2. I have given the files / person name in excel file. If the file name not in the location it is not working. I need to use if condiction in codeing.
Query is given below - using Excel 2000
Sub Mail()
Worksheets("Draft Mail").Select
Range("b16").Select
Do Until ActiveCell = "Finish"
Dim objOutlook As Object
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String
Dim emlHTMLBody, sendTo As String
Dim wkbook As String
Application.ScreenUpdating = False
Set objOutlook = CreateObject("Outlook.Application")
Set objMailMessage = objOutlook.CreateItem(0)
With objMailMessage
.To = ActiveCell
.CC = ActiveCell.Offset(0, 1)
.Subject = ActiveCell.Offset(0, 2)
.body = ActiveCell.Offset(0, 3)
.Attachments.Add "C:\Documents and Settings\Username\Desktop\Process\Remainder Mail\Mail\" & ActiveCell.Offset(0, -1) & ".xls"
End With
ActiveCell.Offset(1, 0).Select
Loop
End Sub
Last edited by sekar.suman; 10-07-2009 at 10:14 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks