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:

Code:
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
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

xld

Banned
Joined
Feb 8, 2003
Messages
5,378
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.
 

Draikonis

New Member
Joined
Jul 8, 2010
Messages
7
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:

Code:
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
 

Draikonis

New Member
Joined
Jul 8, 2010
Messages
7
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,321
Messages
5,624,003
Members
416,004
Latest member
reitz1

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
Top