+ Reply to Thread
Results 1 to 10 of 10

"<img src=" in HTMLBody - Image Not Loading

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    "<img src=" in HTMLBody - Image Not Loading

    .
    Want to load an image into a VBA created OUTLOOK email using the code below. Rather than use the DOCUMENTS folder (because everyone's path is slight different), I'd like to use the workbook path (place the
    image in the same folder as the workbook).

    In place of : "C:\Users\My\Documents" I've tried "ENVIRON" and "Application.ThisWorkbook.Path" and also Application.ActiveWorkbook.Path .

    What syntax can be used to access the image in the same folder as the workbook ?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: "<img src=" in HTMLBody - Image Not Loading

    Are you wanting it to display in the body of the email? If so you'll need to attach it or host is somewhere, it's pretty unlikely that other users will already have that picture on their computer

  3. #3
    Valued Forum Contributor
    Join Date
    12-01-2016
    Location
    Planet Earth
    MS-Off Ver
    95 - 2016
    Posts
    343

    Re: "<img src=" in HTMLBody - Image Not Loading

    Image must be saved in the same folder if linking to an un-hosted file

    Insert this code after your Dim(s)
    Please Login or Register  to view this content.
    Then change With section to

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: "<img src=" in HTMLBody - Image Not Loading

    That won't make it display in the email though for other people...

  5. #5
    Valued Forum Contributor
    Join Date
    12-01-2016
    Location
    Planet Earth
    MS-Off Ver
    95 - 2016
    Posts
    343

    Re: "<img src=" in HTMLBody - Image Not Loading

    Quote Originally Posted by Kyle123 View Post
    That won't make it display in the email though for other people...
    Based on Logit's request,
    Quote Originally Posted by Logit View Post
    .
    Rather than use the DOCUMENTS folder (because everyone's path is slight different), I'd like to use the workbook path (place the image in the same folder as the workbook).
    I'm positive that it would work for everyone considering that the image is indeed placed in the same folder as the workbook.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: "<img src=" in HTMLBody - Image Not Loading

    That depends if the other users have access to the path

  7. #7
    Valued Forum Contributor
    Join Date
    12-01-2016
    Location
    Planet Earth
    MS-Off Ver
    95 - 2016
    Posts
    343

    Re: "<img src=" in HTMLBody - Image Not Loading

    If the user has access to the workbook path, and the image resides there. Then the user should also have access to the image. correct? or am I missing something

    Please Logit, jump in

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: "<img src=" in HTMLBody - Image Not Loading

    Yes, it's generating a email - if the receiver of the email doesn't have access, they won't see the image.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: "<img src=" in HTMLBody - Image Not Loading

    .
    Syrkrasi

    Thank you and everyone else for responding. Syrkasi your solution works like a charm ! Exactly what I was looking for.

    Thank you all again so much !

    Cheers !

  10. #10
    Valued Forum Contributor
    Join Date
    12-01-2016
    Location
    Planet Earth
    MS-Off Ver
    95 - 2016
    Posts
    343

    Re: "<img src=" in HTMLBody - Image Not Loading

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Make an image "draggable" within an image control rather than scaling it
    By jerH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2017, 01:56 PM
  2. Macro for "Master" and "Child" products with image files
    By ddenicola in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2014, 08:30 AM
  3. Excel 2010 "vlookup pictures vba" links image instead of saving it as an image
    By neverdom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2013, 04:17 AM
  4. Replies: 2
    Last Post: 07-17-2013, 12:12 PM
  5. Extract and display image URL from "Linked image cannot be displayed" pictures
    By apyken in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2013, 09:52 PM
  6. Replies: 2
    Last Post: 05-12-2013, 09:51 PM
  7. [SOLVED] Automatically adding image extension ".jpg" to end of image name
    By Alain in forum Excel General
    Replies: 1
    Last Post: 08-03-2006, 08:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1