Email from Excel Function

C

Crazyhorse

Set oOMail = oOApp.CreateItem(olMailItem)
With oOMail
.Display
.Body = eBody
.To = eTo
.CC = ecc
.Attachments.Add eAttach, olByValue, 1
.Subject = eSubject

.Send
End With


How do I add my signature?

Thanks
 
C

Crazyhorse

I figured it out.

SigString = "C:\Documents and Settings\" & Environ("username") & _
"\Application Data\Microsoft\Signatures\Sig.txt"

If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If


Set oOMail = oOApp.CreateItem(olMailItem)
With oOMail
'.Display
.To = eTo
.CC = ecc
.Subject = eSubject
.Body = vbNewLine & vbNewLine & eBody & vbNewLine &
Signature
.Attachments.Add eAttach, olByValue, 1
.Send
End With
Set oOMail = Nothing



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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top