Add signature from file to this VBA code

djbliss

New Member
Joined
Dec 5, 2013
Messages
1
hello,

please can anyone help me with my issue. I have simple vba code to sending emails from excel and I need add the signature from signature.htm file to the end of email body. I tried whatever I found but nothing works for me.

Thank you..


My basic code is:

Code:
Private Sub CommandButton1_Click()
sendemail
End Sub


Public Function sendemail()
On Error GoTo ende
esubject = "xxx"
sendto = "xxx"
eBody = "Dear all"

newfilename = "file.xls"


    
Set app = CreateObject("Outlook.Application")
Set itm = app.CreateItem(0)


With itm
.Subject = esubject
.to = sendto
.cc = ccto
.Body = eBody
.attachments.Add (newfilename)
.display
.Send


End With
Set app = Nothing
Set itm = Nothing


ende:
End Function
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Use HTMLBody instead of Body, create the body text with HTML tags, read all lines from signature.htm and append them to HTMLBody.
 
Upvote 0

Forum statistics

Threads
1,223,956
Messages
6,175,607
Members
452,660
Latest member
Zatman

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