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
 

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.
 

Forum statistics

Threads
1,082,251
Messages
5,364,040
Members
400,774
Latest member
Goldi paul

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top