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
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