NewOrderFac33
Well-known Member
- Joined
- Sep 26, 2011
- Messages
- 1,275
- Office Version
- 2016
- 2010
- Platform
- Windows
Good afternoon,
I'm generating an email in VBA and I want to include a JPEG file in the body of the email:
I currently have:
where "PicFile" is a worksheet cell contaniing the full pathname of a JPEG file.
Hpwever, when I run the following code:
my previewed message includes the pathname of the .jpg file as a string, but not the .jpg itself.
Can anyone give me a pointer as to where I'm going wrong, please?
Thanks in advance
Pete
I'm generating an email in VBA and I want to include a JPEG file in the body of the email:
I currently have:
Code:
Set InfoSheet = Sheets("InfoSheet")
Dim PicFile As Range
Set PicFile = InfoSheet.Range("PicFile")
MsgBody = MsgBody & "<HTML><BODY><IMG src='PicFile' /></BODY></HTML>"
Hpwever, when I run the following code:
Code:
With OutMail
.To = Email_To
.CC = Email_CC
.Subject = Email_Subject
.HTMLbody = MsgBody
'.attachments.Add Email_Attachment_10
.Display
'.Send
End With
Can anyone give me a pointer as to where I'm going wrong, please?
Thanks in advance
Pete