Embed Images with CDO mail - additional question

Harris Steinman 20 Reputation points
2023-05-19T13:31:15.34+00:00

Hi, I have seen David JunFeng's solution to embedding inline images at https://social.msdn.microsoft.com/Forums/en-US/f8c701b7-fbef-4a1f-9549-2fd16191dd20/embed-images-with-cdo-mail-in-excel?forum=exceldev

The solution is for embedding inline images (graphics).

In addition, I would like to add an attachment to the email - as an attachment and not inline.

I am struggling to work out how to do this.

Can anyone (David JunFeng?) offer a solution please, i.e., the line of code I have to add - to solve this?

Thanks

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Access | Development
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Colin Riddington 141 Reputation points MVP
    2023-05-26T07:54:14.13+00:00

    Just to clarify - you say you have now solved the issue ... but the phrasing of that paragraph suggests otherwise.

    If not yet solved, review the code in the sub TestHTMLEMail in my example app.

    This includes code for one inline image and for one or more attachments. You should easily be able to adapt the code to include additional inline images anywhere in the message

    Capture


1 additional answer

Sort by: Most helpful
  1. Colin Riddington 141 Reputation points MVP
    2023-05-25T19:49:50.7733333+00:00

    Please see my example app https://www.isladogs.co.uk/email-tester/index.html

    This includes both attachments and inline images (for HTML email) with CDO email from Access

    However, many email clients now block inline images for security reasons so you cannot guarantee that the images you send will be displayed


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.