Hello everyone,
I'm trying to create a code to add an image with hyper link (which was retrieved from a cell in excel sheet) into email signature.
But my code keeps adding the image before the email body. I couldn't any way to adjust this.
Attach is my code for reference. Really appreciate some help to resole this issue. Thank you very much.
Sub EmailSignature()
Dim SignatureImage As Shape Set SignatureImage = ThisWorkbook.Sheets("sheet1").Shapes("Picture 1") 'Copy the image to the clipboard SignatureImage.CopyPicture 'Create a new email message Dim OutApp As Object Dim OutMail As Object Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) 'Paste the image into the email message body and set the hyperlink With OutMail .Display .HTMLBody = "<html><body>" & _ "<img src='cid:SignatureImage'>" & _ "<p>Dear Sir/Madam,</p>" & _ "<p>Please find below the report for this month:</p>" & _ "<p>Best regards,</p>" & _ "</body></html>" .GetInspector.WordEditor.Range(0, 0).PasteAndFormat wdChartPicture '.GetInspector.WordEditor.InlineShapes(1).Hyperlink.Address = "http://www.google.com" End With
End sub