VBA code-Signature code failure

khaledocom

New Member
Joined
Jan 1, 2010
Messages
29
The bellow code shows Excel VBA code to make signature for outlook 2007 outgoing messages.
It works properly but doesn't show the picture in signature (Pic is not appearing). Can you help with this regarding.


<table width="560" border="0" cellpadding="0" cellspacing="0"><col style="width: 42pt;" width="56" span="10"> <tbody><tr style="height: 15.75pt;" height="21"> <td colspan="10" class="xl22" style="height: 15.75pt; width: 420pt;" width="560" height="21">The pic (photo) in my signature doesn't appear when I use signature code</td> </tr> <tr style="height: 15.75pt;" height="21"> <td colspan="10" class="xl22" style="height: 15.75pt;" height="21">It show only red X on top.
</td> </tr> </tbody></table>
Code:

Function GetBoiler(ByVal sFile As String) As String

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




Sub Mail_Outlook_With_Signature_Plain()

Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

strbody = "Go for test mode of Qtel billing and recovery"





SigString = "C:\Documents and Settings\" & Environ("username") & _
"\Application Data\Microsoft\Signatures\Khaledo.htm"


If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

On Error Resume Next
With OutMail
.To = "khaledocom@yahoo.com"
.CC = ""
.BCC = ""
.Subject = "Test Mode"
.HTMLBody = strbody & "<br><br>" & Signature

.Send
End With

On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


I'm very thankful for your help and support.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
If you post HTML in a message on this forum, the board software will attempt to interpret the HTML. Check above to see what your post looks like.

Try posting between HTML tags or inserting a space after each < character.

When you say you picture doesn't appear, do you mean it doesn't appear at your end, i.e. in the message your Sent Items folder? Or does it appear in your Sent Items but not when it gets to the recipient's Inbox?
 
Upvote 0
Thanks for reply Ruddles,
The recipient can't see the pic in signature.
Over and above one I open sent item to vies the message itself, the
pic is not appearing as well.

Thanks again for your help.
 
Upvote 0
Please post your code and I'll take a look at it.
 
Upvote 0
Here's the code again:
_____________________________________________________
Function GetBoiler(ByVal sFile As String) As String
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
_____________________________________________________
Sub Mail_Outlook_With_Signature_Plain()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Go for test mode of Qtel billing and recovery"
SigString = "C:\Documents and Settings\" & Environ("username") & _
"\Application Data\Microsoft\Signatures\Khaledo.htm"
If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If
On Error Resume Next
With OutMail
.To = "khaledocom@yahoo.com"
.CC = ""
.BCC = ""
.Subject = "Test Mode"
.HTMLBody = strbody & "<br><br>" & Signature
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
 
Upvote 0
Is the reference to the picture in Khaledo.htm?
 
Upvote 0
Yes, it is. the full path for the file:

C:\Documents and Settings\" & Environ("username") & _
"\Application Data\Microsoft\Signatures\Khaledo.htm
 
Upvote 0
Can you show us the contents of that file?

(Insert a space after each < character.)
 
Upvote 0
If I could attach the Excel file to you, I would do but I don't have the right as per mrexcel forum's policy.

It's a file contains customer's list.
In this file there's a column for links to Excel files represents link to GL account.
The code will send a message from our company to each customer attaching his GL account.

I hope this cleared my subject.
 
Upvote 0
Khaledo.htm contains a customer list? I thought it contained your signature?
 
Upvote 0

Forum statistics

Threads
1,216,743
Messages
6,132,457
Members
449,729
Latest member
davelevnt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top