+ Reply to Thread
Results 1 to 11 of 11

Adding Logo that is a variable to email body

  1. #1
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    405

    Adding Logo that is a variable to email body

    I have been able to now add a logo (graphic) to the body of an email with this code:

    Please Login or Register  to view this content.
    I would like to make that Logo.png be a variable that I find in a cell on my open worksheet. Have written this code but it does not work
    Please Login or Register  to view this content.
    Any ideas?
    Last edited by Bobbbo; 06-08-2016 at 12:38 PM. Reason: Mark it solved

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Adding Logo that is a variable to email body

    Just a guess but are you using the right name? In your code that worked you used logo1.png but on your explanation you used logo.png! Are you using the exact spelling in your Q12 cell with the .png extension?
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    405

    Re: Adding Logo that is a variable to email body

    Quote Originally Posted by Crooza View Post
    Just a guess but are you using the right name? In your code that worked you used logo1.png but on your explanation you used logo.png! Are you using the exact spelling in your Q12 cell with the .png extension?
    Sorry for the confusion, probably a bad choice of names. In cell Q12 there is a formula that determines the picture (logo) name. In this case the formula returns= logo1.png. The variable DIM logo assigns the path for the picture. Then I was expecting that in this code below the 'logo' would be replaced with the Path assigned to that picture.
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Adding Logo that is a variable to email body

    This works for me

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    405

    Re: Adding Logo that is a variable to email body

    Quote Originally Posted by Crooza View Post
    This works for me

    Please Login or Register  to view this content.
    Thanks I will give it a try and let you know.

  6. #6
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    405

    Re: Adding Logo that is a variable to email body

    Quote Originally Posted by Bobbbo View Post
    Thanks I will give it a try and let you know.

    I tried it out and it works perfectly. Is there a way you can have it put a picture, like "Picture 200" found on a page of the workbook rather than a path to a picture found on your hard drive?

  7. #7
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    405

    Re: Adding Logo that is a variable to email body

    Quote Originally Posted by Crooza View Post
    This works for me

    Please Login or Register  to view this content.

    I tried it out and it works perfectly. Is there a way you can have it put a picture, like "Picture 200" found on a page of the workbook rather than a path to a picture found on your hard drive?

  8. #8
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Adding Logo that is a variable to email body

    Never tried that. I'll see what I can do.

  9. #9
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    405

    Re: Adding Logo that is a variable to email body

    Quote Originally Posted by Crooza View Post
    Never tried that. I'll see what I can do.
    Great thanks and also thanks for your previous solution!

  10. #10
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Adding Logo that is a variable to email body

    Double post
    Last edited by Crooza; 06-09-2016 at 11:38 PM. Reason: Double POST!!!!!

  11. #11
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Adding Logo that is a variable to email body

    Sorry for delay but this should do what you want. (if you've got more than one embedded image though let me know as this takes the first shape it finds on the page.) If you've got more than one shape / picture it might grab the wrong one.

    Not all my own work - I borrowed code form another source. It's a bit of a workaround as I couldn't see how you can take an embedded file from your workbook and put it into an email without first saving it as a file so it creates a chart, saves to a temp directory on your c: drive then deletes the chart then uses the file in the email program. If you've got security settings on your c: drive this may stuff it up too!!

    give it a go and let me know how it works. (It works my end)


    Please Login or Register  to view this content.

+ 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. increase the font size of a variable in the body of email
    By NeoDasari in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2015, 05:11 PM
  2. [SOLVED] Adding a Range to an Email Body
    By djfatboyfats in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-13-2014, 11:29 AM
  3. Adding to body in email
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-24-2013, 03:09 PM
  4. Adding body to email via VBA for an outlook template
    By teekayy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2012, 04:19 AM
  5. [SOLVED] Adding a disclaimer changes image in email body
    By johncassell in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2012, 08:42 AM
  6. Email Macro in Excel 2007 with Variable name in Body
    By AdrianoF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2009, 03:40 AM
  7. Adding text to body of email with workbook attached.
    By aph in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2005, 11:11 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