Sending an email with signature. Need some help.

B

Bruce

I am trying to write a macro that with send out an email. (This is being
launched from excel)
When I run the macro, it puts the signature, but all embedded images are not
included and show the boxes where they should be

I have tried the following:

sigstring =
"C:\Users\Bruce\AppData\Roaming\Microsoft\Signatures\yourRoamingNotary.com.htm"

If Dir(sigstring) <> "" Then
Signature = GetBoiler(sigstring)
Else
Signature = ""
End If
On Error GoTo 0


For Each oAccount In OutApp.Session.Accounts
If oAccount.AccountType = olPop3 Then
If oAccount.DisplayName = "(e-mail address removed)" Then
MsgBox "Sending out!"


Dim oMail As Outlook.MailItem
Set oMail = OutApp.CreateItem(olMailItem)
oMail.To = emailname
oMail.CC = ""
oMail.BCC = bbcname
oMail.Subject = "Here is the subject..."
oMail.Recipients.ResolveAll
oMail.HTMLBody = RangetoHTML(rng) '& vbNewLine & vbNewLine &
Signature
oMail.Attachments.Add ("C:\notary\invoice.pdf")
oMail.SendUsingAccount = oAccount
oMail.Send

Sheets("Marketing").Select
Range("L" & rowi).Select
ActiveCell.FormulaR1C1 = ActiveCell.FormulaR1C1 & " Sent: " &
Format(Now, "mmm-d-yyyy hh:mm")



'Range("BR29").Select
'.temp_.Select



End If

End If
Next


Function GetBoiler(ByVal sFile As String) As String
'Dick 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
 
M

Michael Bauer [MVP - Outlook]

Here's a sample for how to do that with the Redemption (www.dimastr.com):

http://www.vboffice.net/sample.html?mnu=2&lang=en&smp=29&cmd=showitem&pub=6

Sorry, the description isn't translated yet. It demos how to insert an image
or audio file in an html e-mail. You can use a placeholder (@0) to determine
where to insert it. Without using the plpaceholder, the image will be
appended at the end.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Sat, 1 Sep 2007 10:48:41 -0700 schrieb Bruce:
 

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