+ Reply to Thread
Results 1 to 5 of 5

sending Email (via outlook) from Excel with cell range and image from external file

Hybrid View

Kramxel sending Email (via outlook)... 04-17-2012, 09:32 AM
Chippy Re: sending Email (via... 04-17-2012, 12:24 PM
Kramxel Re: sending Email (via... 04-19-2012, 06:25 AM
Chippy Re: sending Email (via... 04-19-2012, 08:59 AM
Kramxel Re: sending Email (via... 04-20-2012, 11:10 AM
  1. #1
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: sending Email (via outlook) from Excel with cell range and image from external file

    Your initial reply, now edited, asked how to put the image at the top of the email rather than the bottom. Maybe you've worked it out, but for the benefit of others here's how.

    Replace:
        'Find HTML body closing tag and insert embedded image reference before it
        
        p = InStr(HTML, "</body>")
        HTML = Left(HTML, p - 1) & "<p>The embedded image is shown below.</p><img src='cid:" & imageFileName & "'>" & Mid(HTML, p)
    with:
        'Find HTML body opening tag and insert embedded image reference after it
        
        p = InStr(HTML, "<body>") + Len("<body>")
        HTML = Left(HTML, p) & "<p>The embedded image is shown below.</p><img src='cid:" & imageFileName & "'>" & Mid(HTML, p)
    Post responsibly. Search for excelforum.com

  2. #2
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Re: sending Email (via outlook) from Excel with cell range and image from external file

    Hi Chippy,

    Yes I did manage to work it out realised like most things the solution was far easier than I was expecting so quickly removed it (well not as quickly as I had hoped).

    once again thank you so much.

    althogh I didn't add the + Len("<body>") O just took the / away... i'll add that now and see what the difference is.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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