+ Reply to Thread
Results 1 to 2 of 2

Inserting .GIF into email from spreadsheet

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    Birmingham
    MS-Off Ver
    Excel 2010
    Posts
    3

    Inserting .GIF into email from spreadsheet

    Hello All,

    Still getting to grips with VBA so your help is needed! I need direction on how to insert an image to the body of an email I am generating using VBA - the email code is fine and works perfectly however i am now looking to add a header image within the body of the email to make it look more professional and don't really know where to start? I have looked at other threads but they seem to focus on adding charts etc when all i need is to add the image from a sheet within the workbook to the email above the body of the text?

    My code is below is a small element of the email portion (as i said this works fine - i just don't know how to add the image to within the body?) your help would be greatly apprecaited! I am using MSO 2010 for both OUTLOOK & EXCEL

    ' ----------------------------

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    With Destwb
    .SaveAs TempFilePath & TempFileName & FileExtStr, _
    FileFormat:=FileFormatNum
    On Error Resume Next
    With OutMail
    .To = Sheet1.Range("F_EMAIL1").Value & " ; " & Sheet1.Range("F_EMAIL2").Value & " ; " & Sheet1.Range("F_EMAIL3").Value & " ; " & Sheet1.Range("F_EMAIL4").Value & " ; " & Sheet1.Range("F_EMAIL5").Value
    .cc = Sheet1.Range("F_CCMAIL1").Value & " ; " & Sheet1.Range("F_CCMAIL2").Value & " ; " & Sheet1.Range("F_CCMAIL3").Value & " ; " & Sheet1.Range("F_CCMAIL4").Value & " ; " & Sheet1.Range("F_CCMAIL5").Value
    .BCC = ""
    .Subject = Sheet1.Range("F_EMAILSUBJECT").Value & Sheet1.Range("F_CUSTNAME").Value & " - " & Sheet1.Range("F_MODE").Value & " - " & Sheet9.Range("AD_EMAILSUBJECT").Value
    .body = vbNewLine & vbNewLine & EmailContent.TextBox1.Value
    .attachments.Add Destwb.FullName
    .Display
    End With

    ' ----------------------------

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Inserting .GIF into email from spreadsheet

    I think this answers your question. (Search is your friend.)

    You will still have to export the picture, treating it like a chart object.
    David
    (*) Reputation points appreciated.

+ 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. Match Email ID Before Inserting
    By niladri2005 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-03-2013, 12:38 PM
  2. Excel code to email whats in the spreadsheet in the body of email
    By Kain93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 09:55 AM
  3. Inserting Email attachmets from sheet
    By damage in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2010, 01:57 AM
  4. Inserting a table in an email programatically
    By xzibited in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2008, 01:10 PM
  5. [SOLVED] Transfer Email addresses from spreadsheet to email address book
    By Beana in forum Excel General
    Replies: 2
    Last Post: 05-30-2006, 01:10 PM

Tags for this Thread

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