MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question
mrexcel.com/board/threads/imag…n-e-mail-via-vba.1145132/
Hello everyone,
I have a macro-code that attaches a picture in the e-mail body from the excel Activesheet. My problems are:
- Is there a possibility to place the image above "Thank you" line ?
- If I want to insert a second picture how can I modify the code so that the Picture2 will be placed bellow Picture1 (currently it's placing in the right of Picture1)
Any ideas ?
Code
- Sub create_email_2()
- Dim oApp As Outlook.Application
- Dim email As Outlook.MailItem
- Dim inspect As Outlook.Inspector
- Dim content As Object
- Set oApp = New Outlook.Application
- Set email = oApp.CreateItem(olMailItem)
- With email
- .To = "[email protected]"
- .Subject = "E-mail2"
- .htmbody = "Hello" & "</p>" _
- & "Please see bellow current status" & "</p>" _
- & "Thank you" & "</body></html>"
- .Display
- Set inspect = email.GetInspector
- Set content = inspect.WordEditor
- ActiveSheet.Pictures(1).Copy
- content.Application.Selection.Start = Len(.Body)
- content.Application.Selection.Paste
- 'ActiveSheet.Pictures(2).Copy
- 'content.Application.Selection.Start = Len(.Body)
- 'content.Application.Selection.Paste
- .Save
- '.Send
- End With
- End Sub