scubadiver007
Registered User.
- Local time
- Today, 11:53
- Joined
- Nov 30, 2010
- Messages
- 317
I would like to add the signature. I've seen this link on other forums but it no longer works.
http://www.rondebruin.nl/mail/folder3/signature.htm
Then I saw this:
http://stackoverflow.com/questions/8994116/how-to-add-default-signature-in-outlook
There is a guaranteed signature so the above code can be simplified but not sure how.
Also, what is the "getboiler" function?
http://www.rondebruin.nl/mail/folder3/signature.htm
Then I saw this:
http://stackoverflow.com/questions/8994116/how-to-add-default-signature-in-outlook
Code:
Dim OlApp As Outlook.Application
Dim ObjMail As Outlook.MailItem
Dim BodyHtml As String
Dim DirSig As String
Dim FileNameHTMSig As String
Dim Pos1 As Long
Dim Pos2 As Long
Dim SigHtm As String
DirSig = "C:\Users\" & Environ("username") & _
"\AppData\Roaming\Microsoft\Signatures"
FileNameHTMSig = Dir$(DirSig & "\*.htm")
' Code to handle there being no htm signature or there being more than one
SigHtm = [B][COLOR=red]GetBoiler[/COLOR][/B](DirSig & "\" & FileNameHTMSig)
Pos1 = InStr(1, LCase(SigHtm), "<body")
' Code to handle there being no body
Pos2 = InStr(Pos1, LCase(SigHtm), ">")
' Code to handle there being no closing > for the body element
BodyHtml = "<table border=0 width=""100%"" style=""Color: #0000FF""" & _
" bgColor=#F0F0F0><tr><td align= ""center"">HTML table</td>" & _
"</tr></table><br>"
BodyHtml = Mid(SigHtm, 1, Pos2 + 1) & BodyHtml & Mid(SigHtm, Pos2 + 2)
Set OlApp = Outlook.Application
Set ObjMail = OlApp.CreateItem(olMailItem)
ObjMail.BodyFormat = olFormatHTML
ObjMail.Subject = "Subject goes here"
ObjMail.Recipients.Add "my email address"
ObjMail.Display
There is a guaranteed signature so the above code can be simplified but not sure how.
Also, what is the "getboiler" function?