A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

add HTML signature within an HTML message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 18th 07, 01:13 PM posted to microsoft.public.outlook.program_vba
wilma2299
external usenet poster
 
Posts: 4
Default 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!!

  #2  
Old April 18th 07, 08:02 PM posted to microsoft.public.outlook.program_vba
Wolfram Jahn
external usenet poster
 
Posts: 12
Default 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
  #3  
Old April 18th 07, 09:00 PM posted to microsoft.public.outlook.program_vba
wilma2299
external usenet poster
 
Posts: 4
Default 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 "

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML Signature Duncs Outlook - General Queries 2 February 5th 07 10:19 PM
HTML Signature with Picture Logo charlie0913 Outlook Express 28 November 4th 06 02:48 PM
how to HTML signature Alli Outlook - General Queries 2 October 31st 06 08:19 PM
FYI: Eingebundene Bilder in Outlook-HTML-Mail / embedded graphics in HTML Stefan Wirrer Outlook - General Queries 1 August 17th 06 02:25 PM
Outllook 2003 Changing my HTML signature. [email protected] Outlook - General Queries 1 June 21st 06 07:57 PM


All times are GMT +1. The time now is 11:16 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-2025 Outlook Banter.
The comments are property of their posters.