Macro Excel / vba – Include style in an email with images
- or -
Post a project like this894
€10(approx. $11)
- Posted:
- Proposals: 2
- Remote
- #3423941
- Awarded
Description
Experience Level: Entry
I need to send an email via macro excel with two images in it.
I have this function:
Sub Send_Mail()
'BE CAREFUL!!!! Activate library Microsoft Outlook 16.0 Object Library or higer!!
Dim olApp As Object
Dim olMailItm As Object
Set olApp = CreateObject("Outlook.Application")
Set olMailItm = olApp.CreateItem(0)
With olMailItm
.To = "xxxx@xxx.com"
.Subject = "Test mail"
.HTMLBody = "Lorem ipsum dolor sit amet," _
& "consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." _
& "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." _
& "xcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + ActiveCell.Offset(0, 1).Value + "" _
& "Regards," _
& "Example area " & vbLf
.Display
'.Send
End With
Set olMailItm = Nothing
Set olApp = Nothing
End Sub
You can see an example of what I get with the code in the attachment named “as_is.png”. The text is not aligned with the top of the image
I need you to include the styling in this code to achieve the look of the attachment “to_be1.png”
Be careful, because depend on the device/anchor of the screen the text should be adapted “to_be2.png”
I have this function:
Sub Send_Mail()
'BE CAREFUL!!!! Activate library Microsoft Outlook 16.0 Object Library or higer!!
Dim olApp As Object
Dim olMailItm As Object
Set olApp = CreateObject("Outlook.Application")
Set olMailItm = olApp.CreateItem(0)
With olMailItm
.To = "xxxx@xxx.com"
.Subject = "Test mail"
.HTMLBody = "Lorem ipsum dolor sit amet," _
& "consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." _
& "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." _
& "xcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + ActiveCell.Offset(0, 1).Value + "" _
& "Regards," _
& "Example area " & vbLf
.Display
'.Send
End With
Set olMailItm = Nothing
Set olApp = Nothing
End Sub
You can see an example of what I get with the code in the attachment named “as_is.png”. The text is not aligned with the top of the image
I need you to include the styling in this code to achieve the look of the attachment “to_be1.png”
Be careful, because depend on the device/anchor of the screen the text should be adapted “to_be2.png”
Ildefonso S.
100% (4)Projects Completed
4
Freelancers worked with
4
Projects awarded
60%
Last project
19 Oct 2021
Spain
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies