Hi,
I need the below formatted text in the Excel VBA Code to appear as Message Body. (in place of MyItem.Body in Code). Thanks in advance.
Formatted Text :
Code :
I need the below formatted text in the Excel VBA Code to appear as Message Body. (in place of MyItem.Body in Code). Thanks in advance.
Formatted Text :
Hi Sir/ Madam,
Please find the attached receipt for your donations. Your contributions are invaluable to the Children.
Thanks for your support.
Please find the attached receipt for your donations. Your contributions are invaluable to the Children.
Thanks for your support.
Code :
HTML:
Sub receipt_mail()Dim outobj, mailobjDim MyItem As Outlook.MailItem
Set outobj = CreateObject("Outlook.Application")Set mailobj = outobj.CreateItem(O)Set MyItem = outobj.CreateItemFromTemplate("D:\ThatsMyChild\Mail.oft")
Sheets("Receipt").Activate
MMMYYY = Worksheets("Receipt").Cells(4, "AD").Value
With mailobj'.To = toMail.To = Worksheets("Receipt").Cells(6, "AE").Value
.Subject = "Receipt : " & MMMYYY
.Body = MyItem.Body
.Attachments.Add (FName).SendEnd With
Set outobj = NothingSet mailobj = NothingSet objDoc = Nothing
End Sub