Results 1 to 10 of 28

Thread: Automatic sort due date and send email

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Apr 2018
    Posts
    23
    Rep Power
    0
    Hi Alan,
    So far, I didn't receive any of your email with the template. That is weird. Can you please send it through our gmail.

    I am using my template on my desk top with your VBA code and it is working. It sent notification through our gmail. Now how can i turn it to a good template and send notification through my outlook email? Also, can you help create Subject and Body on the email with hyperlink to the template. Example.

    Subject: Tool and Equipment up for service
    Body: Please review the list item need to be service below and open the hyperlink -->


    Here is example of coding for another template that i had created in the past with Outlook email with Subject, body and hyperlink to the template.
    Private Sub cmdNot_Click()

    Dim OutApp As Object
    Dim OutMail As Object
    Dim fileName As String
    Dim mSubject As String
    Dim signature As String
    Dim fname As String
    Dim mBody As String
    Dim rng As Range
    Dim rng1 As Range
    Dim ws As Worksheet
    Dim mailTo As String
    Set ws = Sheets("MRO")
    fname = ws.Range("B4")
    mSubject = "MRO " & " For " & Range("C6").Value
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    'mBody = "2-SO\Material Request Form .xlsm"

    Dim Path As String

    mBody = "<font size=""3"" face=""Calibri"">" & _
    "Dear Team,<br><br>" & _
    "Please open the file from below link and put your signature on the respective cell after you completed your task.<br><B>" & _
    fileName & ".xlsm" & "</B> is created.<br>" & _
    "Click on this link to open the file : " & _
    "<A HREF=""file://" & Path & fileName & ".xlsm" & _
    """>Files are saved here</A>" & "-->" & Range("C6").Value & _
    "<br><br>Best Regards," & _
    "<br><br></font>"

    With OutMail
    .display
    End With
    signature = OutMail.body
    With Application
    .EnableEvents = False
    .ScreenUpdating = False
    End With


    With OutMail
    '.To = "email"
    .To = ""
    .CC = ""
    .BCC = ""
    .Subject = mSubject
    '.body = "Dear Team," & vbCrLf & vbCrLf & "Please open the file from below link and put your signature on the respective cell and save the sheet"
    '.htmlbody = RangetoHTML(rng)
    .htmlbody = mBody
    '.Attachments.Add fileName
    .display
    End With
    'ws.PageSetup.RightHeader = "&""Calibri,italic""&11& " & ws.Range("A1")
    ActiveWorkbook.Close False
    ActiveWorkbook.Close
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing

    With Application
    .ScreenUpdating = True
    .EnableEvents = True
    End With
    Last edited by Thainguyen; 05-23-2018 at 04:05 AM.

Similar Threads

  1. Replies: 1
    Last Post: 06-28-2014, 11:31 AM
  2. Find the value of the due date falls between two dates
    By mahmoud-lee in forum Excel Help
    Replies: 2
    Last Post: 03-14-2014, 10:48 AM
  3. Replies: 4
    Last Post: 02-03-2014, 07:01 PM
  4. Replies: 1
    Last Post: 11-20-2013, 09:14 AM
  5. Replies: 2
    Last Post: 05-23-2013, 08:08 AM

Posting Permissions

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