![]() |
add HTML signature within an HTML message
I'm not really sure what I'm doing or what I'm doing incorrectly. I'm
trying to add my signature to a macro that i've created. Here is the macro: 'code added to use signature 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 'start original code Sub Send_Files() 'Working in 2000-2007 Dim OutApp As Object Dim OutMail As Object Dim sh As Worksheet Dim cell As Range, FileCell As Range, rng As Range Dim strbody As String Dim SigString As String Dim Signature As String With Application .EnableEvents = False .ScreenUpdating = False End With Set sh = Sheets("Sheet1") Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon For Each cell In sh.Columns("B").Cells.SpecialCells(xlCellTypeConst ants) 'Enter the file names in the C:Z column in each row Set rng = sh.Cells(cell.Row, 1).Range("C1:Z1") If cell.Value Like "?*@?*.?*" And _ Application.WorksheetFunction.CountA(rng) 0 Then Set OutMail = OutApp.CreateItem(0) With OutMail .To = cell.Value .Subject = "FEBRUARY 2007 COMMISSION STATEMENT" strbody = "Good Afternoon," & vbNewLine & vbNewLine & _ "Attached is your February 2007 Commission Statement. Please note that the travel and entertainment figures have been updated to reflect the current amounts as of February 2007. If you should have any questions or concerns, please be sure to fill out the "Sales Commissions Inquiry Form". Have a great day." & vbNewLine & _ "Thanks," .Body = strbody 'this is the signature code Ive added SigString = "C:\Documents and Settings\valejill \Application Data\Microsoft\Signatures\Signature1.htm" If Dir(SigString) "" Then Signature = GetBoiler(SigString) Else Signature = "" End If On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .HTMLBody = strbody & "brbr" & Signature 'You can add 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 'resume original code For Each FileCell In rng.SpecialCells(xlCellTypeConstants) If Trim(FileCell) "" Then If Dir(FileCell.Value) "" Then .Attachments.Add FileCell.Value End If End If Next FileCell .Send 'Or use Display End With Set OutMail = Nothing End If Next cell Set OutApp = Nothing With Application .EnableEvents = True .ScreenUpdating = True End With End Sub I've tried to seperate the code I know that works from the signature add ins. Please let me know what syntax is incorrect. Thanks!! |
add HTML signature within an HTML message
wilma2299 wrote:
I'm not really sure what I'm doing or what I'm doing incorrectly. I'm trying to add my signature to a macro that i've created. Here is the macro: [...] I've tried to seperate the code I know that works from the signature add ins. Please let me know what syntax is incorrect. Thanks!! Hi, and what goes wrong? Some symptom? Wolfram |
add HTML signature within an HTML message
On Apr 18, 3:02 pm, Wolfram Jahn wrote:
wilma2299 wrote: I'm not really sure what I'm doing or what I'm doing incorrectly. I'm trying to add my signature to a macro that i've created. Here is the macro: [...] I've tried to seperate the code I know that works from the signature add ins. Please let me know what syntax is incorrect. Thanks!! Hi, and what goes wrong? Some symptom? Wolfram Hi, I get an error message that states the following: Run-time Error '-1387003638(ad54010a)': Automation Error When I click "ok" it sends an email to " |
All times are GMT +1. The time now is 10:44 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com