Please help Adding a text value from the excel cell to the body of the template(msg).

  • Hi All,


    Would you please help me to modify the below code to add a corresponding excel cell value to the predefined template (.msg format) body?.. Copying the code i m using here.


    [INDENT]Sub SendMail()



    Dim olApp As Outlook.Application
    Dim olMail As Outlook.MailItem



    For i = 2 To Sheet1.Cells(Rows.Count, 1).End(xlUp).Row



    Set olApp = New Outlook.Application





    Set olMail = olApp.CreateItemFromTemplate("C:\Users\soonu.thampi\Desktop\Notification.msg")
    Set olMail2 = olApp.CreateItemFromTemplate("C:\Users\soonu.thampi\Desktop\Escalation.msg")



    With olMail



    If Cells(i, 7).Value >= "-30" And Cells(i, 7).Value <= "-45" Then





    .To = Cells(i, 3).Value



    .SentOnBehalfOfName = "[email protected]"


    .Display


    End If
    End With


    With olMail2


    If Cells(i, 7).Value >= "-45" Then







    .To = Cells(i, 3).Value
    .CC = Cells(i, 6).Value


    .SentOnBehalfOfName = "[email protected]"


    .Display


    Else


    End If



    End With



    Set olMail = Nothing
    Set olApp = Nothing



    Next





    End Sub



    [/INDENT]