Hi I am trying to create a Macro which can send mail with multiple embedded images. I want to add different url in each image and embed it as a single image in a table. Once the user click on these different part of single image it should direct him to it's respective website. Please help me with the vba macro code.
I want the said code as an extension of my code in below given question or code pasted here.
How to Change width and height of embedded image in mail using Cell values
Thanks in advance.
Sub SendMail()
Dim olApp As Object
Dim olMail As Object
For I = 2 To Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
With ws
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
End With
With olMail
.To = Cells(I, 2).Value
.cc = Cells(I, 3).Value
.bcc = Cells(I, 4).Value
.Subject = Cells(I, 5).Value
.Body = Cells(I, 6).Value
On Error Resume Next
.Attachments.Add Cells(I, 7).Value
.HTMLBody ="<HTML><center> <img src ="""&Cells(I,10).Value&"""width="""&Cells(I, 8).Value&""" height=""" & Cells(I, 9).Value & """ ><br>"
On Error GoTo 0
.Display
.Send
End With
Next
Set olMail = Nothing
Set olApp = Nothing
MsgBox "Mails Sent Successfully"
End Sub