VBA Business Cards in Outlook Signatures

Littlemalky

Board Regular
Joined
Jan 14, 2011
Messages
223
I'm trying to automate sending out an Excel file through Outlook. I have a signature set up in my Outlook account with my business card within it. I tried using the HTML signature coding from http://www.rondebruin.nl/sendmail.htm; however, the business card imagine does not show up. Everything else worked perfectly, except the image of the card.

Does anyone know how to get the business card signature to show up?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try the below, hope it can help

Code:
With omail
    .To = "[EMAIL="doris.kalio@jubailibros.com"]doris.kalio@jubailibros.com[/EMAIL]"
    .cc = "[EMAIL="imad.elhage@jubailibros.com;mohammed.abuhawash@jubailibros.com;mohammed.moussa@jubailibros.com"]imad.elhage@jubailibros.com;mohammed.abuhawash@jubailibros.com;mohammed.moussa@jubailibros.com[/EMAIL]"
    .Subject = "Your Update Maintenance Contract In PHC" & " " & Format$(Date, "dd ,mmmm,yyyy")
    .attachments.Add wbn.FullName
    Msg = "Dear" & " " & "Doris" & "<br><br>"
    Msg = Msg & "Please find attched file ,"
    Msg = Msg & " If you have any Comment don't Hesitate to reply  me."
    Msg = Msg & "<br><br>"
    .htmlbody = Msg & "<br><br>" & Signature
   .send
   End With
 
Upvote 0
That didn't really work, maybe it will help if I post what I have so far and you can help me add the proper lines to it.

Code:
Sub Mail_Outlook_With_Signature_Html()
'Working in 2000-2010
'This example send the last saved version of the Activeworkbook
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String
    Dim SigString As String
    Dim Signature As String
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    
    strbody = "Top of the mornin' to ya!" & _
              "<br><br>Attached is a copy of the New Release Tracker. Please  inform me if anything needs to be adjusted.<br>" & _
              "<br><br>Have a marvelous day!"
              
           
    SigString = "C:\Documents and Settings\JMalkus\Application Data\Microsoft\Signatures\Best Regards.htm"
    
    If Dir(SigString) <> "" Then
        Signature = GetBoiler(SigString)
    Else
        Signature = ""
    End If
    On Error Resume Next
    With OutMail
        'To: "Name"
        .To = "[EMAIL="JMalkus@oakley.com"]Name[/EMAIL]"
        'CC: "Name"
        .CC = ""
        'BCC: "[EMAIL="JMalkus@oakley.com"]Name[/EMAIL]"
        .BCC = ""
        .Subject = "New Release Tracker " & Format(Date, "m.dd.yy")
        .HTMLBody = strbody & "<br><br>" & Signature
        .Attachments.Add ("G:\Materials\Planning\Trackers\All New Release Tracker\New Release Tracker " & Format(Date, "m.dd.yy") & ".xlsx")
        
        'You can add other files also like this
        '.Attachments.Add ("C:\test.txt")
        '.Send   'or use
        .Display
    End With
    On Error GoTo 0
    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub
 
Upvote 0
Oh sorry, I put it after the End Sub.
Code:
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
 
Upvote 0
The path is working. Everything else in the signature shows up, except the actualy image of the business card is just blank. Do i need to attach the vcf in some way as well?
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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