Results 1 to 14 of 14

VBA to send message with signature, but the image does not load.

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-11-2016
    Location
    Brazil
    MS-Off Ver
    2010
    Posts
    125

    VBA to send message with signature, but the image does not load.

    Hey guys,

    I am trying to send an email with my signature on it.

    Everything works perfectly, but the picture does not load.

    Here is my code:

    Sub testemail()
    '-----------------------------------------
    'DETERMINE IF EMAIL TO BE SENT
    If MsgBox("Send Email?", vbYesNo + vbQuestion, "Email") = vbYes Then
    '-----------------------------------------
    'DECLARE AND SET VARIABLES
        Dim myOutlok As Object
        Dim myMailItm As Object
        Dim Signature As String
        Shell ("OUTLOOK")
        Set otlApp = CreateObject("Outlook.Application")
        Set OtlNewMail = otlApp.CreateItem(olMailItem)
    '-----------------------------------------
    'GET DEFAULT EMAIL SIGNATURE
        Signature = "C:/Users/joao/AppData/Roaming/Microsoft/Assinaturas/Joćo.htm"
        If Dir(Signature, vbDirectory) <> vbNullString Then
            Signature = Signature & Dir$(Signature & "Joćo*.htm")
        Else:
            Signature = ""
        End If
        Signature = CreateObject("Scripting.FileSystemObject").GetFile(Signature).OpenAsTextStream(1, -2).ReadAll
    '-----------------------------------------
    'CREATE EMAIL
        OtlNewMail.HTMLBody = Signature
        With OtlNewMail
        .To = "[email protected]"
        .CC = Range("H10").Value
        .Subject = "Oi"
        .HTMLBody = "Hello," & "<br />" & Range("H12").Value & "<br />" & "<br />" & "<br />" & _
            "Thank you," & "<br />" & "<br />" & Signature
        .display
        '.Send
        End With
    '-----------------------------------------
    'CLEANUP
        Set OtlNewMail = Nothing
        Set otlApp = Nothing
        Set otlAttach = Nothing
        Set otlMess = Nothing
        Set otlNSpace = Nothing
    End If
    End Sub
    What is wrong?
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Including image in signature
    By croppman001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2015, 10:10 AM
  2. [SOLVED] How to add a signature with image using VBA via excel
    By Baldowsky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2013, 12:58 AM
  3. [SOLVED] VBA to send embedded image in email body- NOT USING THE ORGINAL IMAGE SOURCE
    By Coreyusa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-27-2013, 06:48 PM
  4. Linking to an image in another cell (Electronic Signature)
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-16-2010, 05:03 PM
  5. Insert signature image - password protected
    By Dusty Hoffman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-11-2008, 10:41 PM
  6. Replies: 18
    Last Post: 10-11-2007, 04:19 AM
  7. How to paste a image (signature) in a cell in Excel?
    By V.Jeyakumar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2006, 04:20 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