Results 1 to 3 of 3

Including image in signature

Threaded View

  1. #1
    Registered User
    Join Date
    09-17-2014
    Location
    Bolton, England
    MS-Off Ver
    MS Office 13
    Posts
    2

    Including image in signature

    Hi,

    I have a macro which works and displays the email along with the signature. However, I have tried including an image within the signature but when I run the macro, it simply just gives the dreaded red cross as if it can't be shown. The image is a simple jpg and I can't seem to get my head round why.

    Below is the code for my email macro: -

    Sub Email()
    
        Dim OutApp As Object
        Dim OutMail As Object
        Dim strHTMLbody As String
        Dim dtimeStamp As String
        Dim SigString As String
        Dim Signature As String
        Dim ToDate As String
        Dim FromDate As String
        
        FromDate = Format(Now - 10, "dd/mm/yyyy")
        ToDate = Format(Now - 1, "dd/mm/yyyy")
        dtimeStamp = Format(Now, "yyyymmdd")
    
          Set OutApp = CreateObject("Outlook.Application")
          Set OutMail = OutApp.CreateItem(0)   
    
          strHTMLbody = "<font size=""3"" face=""Calibri"">" & _
                      "Hi ,<br><br>" & _
                      "Please find data for the following dates <b>" & FromDate & " - " & ToDate & "<br></B>" & _
                      "<br>" & _
                      "Cloick on the attached link for the latest file" & _
                      "<A HREF=""internal hyperlink" & _
                      """>here</A>" & _
                      "</B><br>" & _
                      "<br><br></font>" 
                
    SigString = Environ("appdata") & _
                    "\Microsoft\Signatures\signature.htm"
    
        If Dir(SigString) <> "" Then
            Signature = GetBoiler(SigString)
        Else
            Signature = ""
        End If     
                                  
            On Error Resume Next 
    
    With OutMail
                .to = "joe.bloggs@email.net"
                .CC = ""
                .BCC = ""
                .Subject = ""
                .HTMLBody = strHTMLbody & "<br>" & Signature
                .Display
                '.Send
            End With
    
    On Error GoTo 0
    
            Set OutMail = Nothing
            Set OutApp = Nothing
    
    End Sub
    
    Function GetBoiler(ByVal sFile As String) As String
    
    Dim fso As Object
        Dim ts As Object
        Set fso = CreateObject("Scripting.FileSystemObject")
        Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
        GetBoiler = ts.readall
        ts.Close
    End Function
    As I said I am at a loss as to why the image would not appear in the signature.

    Any help would be fantastic.

    Thanks,

    Andrew Cropper
    Last edited by croppman001; 02-25-2015 at 10:11 AM. Reason: Forgot to include Code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Outlook Message Format Messes Up When Including a Signature
    By Ross245 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2015, 05:31 PM
  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] Automatic E-mail - include signature including formatting and Image
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2013, 10:11 AM
  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

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