+ Reply to Thread
Results 1 to 2 of 2

sendemail with template

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    sendemail with template

    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?

    Please Login or Register  to view this content.
    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..
    Link

    Thank you very much for all your help!!!!
    A2k

  2. #2
    Registered User
    Join Date
    10-07-2009
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    6

    sendemail with template

    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 09:14 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1