Need another function that can hadle images for signatures

Draikonis

New Member
Joined
Jul 8, 2010
Messages
7
Hello,

I am using Ron de Bruin's macro for creating a PDF-file from active worksheet, creating a new mail in outlook, attaching the PDF and add the company's signature, which consists of an image and contact information (as a .htm document). The problem is that the function I use to process the .htm-file cannot handle images.

Here is the function, by **** Kusleika:

PHP:
Function GetBoiler(ByVal sFile As String) As String
'**** Kusleika
    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

What I need to find out is if there is any other functions I can use, or even another working macro for html signatures.

I am very grateful for any help!

Sincerely,
Amanda
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I don't understand where this function comes into it, doesn't Ron's code do all that you want?

I have some code that takes a sheet, adds a signature, PDFs it, then emails it. GetBoiuler comes nowhere near it.
 
Upvote 0
I don't understand where this function comes into it, doesn't Ron's code do all that you want?

I have some code that takes a sheet, adds a signature, PDFs it, then emails it. GetBoiuler comes nowhere near it.

The function fetches the signature file (htm file) and reads it if I get it right. Ron's code stuffs in the signature at the bottom line in a new e-mail, but since the function lacks the ability to read images all I see is contact information and a broken image link. Here's part of the code:

PHP:
Function GetBoiler(ByVal sFile As String) As String
 '**** Kusleika
     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

SigString = "C:\Documents and Settings\" & Environ("username") & _
                "\Application Data\Microsoft\Signaturer\informell.htm"
                ' winXP
    
If Dir(SigString) <> "" Then
        Signature = GetBoiler(SigString)
    Else
        Signature = ""
    End If

 On Error Resume Next
    With OutMail
        .To = ThisWorkbook.Sheets("Blad1").Range("E9").Value
        ' Fyll detta med definition av vilka mejladresser som gäller
        .CC = ""
        .BCC = ""
        .Subject = "Senaste Serviceprotokoll"
        .HTMLBody = StrBody & "<br><br>" & Signature
        .Attachments.Add FileNamePDF
        If Send = True Then
            .Send
        Else
            .Display
        End If
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
 
Upvote 0
Any ideas? Is there any way around it? I heard something about using MailItem .Display while the object library is enabled would make Outlook include the signature if it is set on automatisation. I don't know how to use this piece of code. I've tried to google it but I coulnd't find anything.
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top