473,385 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Signature Images are not showing when sending email from MSAccess

106 100+
Hi,

I wish to send email with signature from within MSAccess. I have found the code below (http://www.rondebruin.nl/) that helps me to do exactly that however, any images within the signature do not show.

I have tried to contact the author but there is no response.
I was wondering if someone had a solution.

Kind Regards

below is the code

Expand|Select|Wrap|Line Numbers
  1. Sub SendMessageWithSig(DisplayMsg As Boolean, strMailTo As String, Optional AttachmentPath)
  2. ' Don't forget to copy the function GetBoiler in the module.
  3. ' Working in Office 2000-2010
  4.     Dim OutApp As Object
  5.     Dim OutMail As Object
  6.     Dim strbody As String
  7.     Dim SigString As String
  8.     Dim Signature As String
  9.  
  10.     Set OutApp = CreateObject("Outlook.Application")
  11.     Set OutMail = OutApp.CreateItem(0)
  12.  
  13.     strbody = "<H3><B>Dear Customer</B></H3>" & _
  14.               "Please visit this website to download the new version.<br>" & _
  15.               "Let me know if you have problems.<br>" & _
  16.               "<A HREF=""http://www.rondebruin.nl/tips.htm"">Ron's Excel Page</A>" & _
  17.               "<br><br><B>Thank you</B>"
  18.  
  19.     'Use the second SigString if you use Vista or win 7 as operating system
  20.  
  21.     SigString = "C:\Documents and Settings\" & Environ("username") & _
  22.                 "\Application Data\Microsoft\Signatures\real (html).htm"
  23.  
  24.     'SigString = "C:\Users\" & Environ("username") & _
  25.      "\AppData\Roaming\Microsoft\Signatures\Mysig.htm"
  26.  
  27.     If Dir(SigString) <> "" Then
  28.         Signature = GetBoiler(SigString)
  29.     Else
  30.         Signature = ""
  31.     End If
  32.  
  33.     On Error Resume Next
  34.     With OutMail
  35.         .To = strMailTo
  36.         .CC = ""
  37.         .BCC = ""
  38.         .Subject = "Special Offers"
  39.         .HTMLBody = strbody & "<br><br>" & Signature
  40.         'You can add files also like this
  41.         '.Attachments.Add ("C:\test.txt")
  42.         .Attachments.Add ("C:\Documents and Settings\" & Environ("username") & _
  43.                 "\Application Data\Microsoft\Signatures\real (html)_files\image005.jpg")
  44.  
  45.         .Attachments.Add ("s:\plus.bmp")
  46.         .Display   'or use .Display
  47.     End With
  48.  
  49.     On Error GoTo 0
  50.     Set OutMail = Nothing
  51.     Set OutApp = Nothing
  52. End Sub
  53.  
  54.  
  55. Function GetBoiler(ByVal sFile As String) As String
  56. 'Dick Kusleika
  57.     Dim fso As Object
  58.     Dim ts As Object
  59.     Set fso = CreateObject("Scripting.FileSystemObject")
  60.     Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
  61.     GetBoiler = ts.readall
  62.     ts.Close
  63. End Function
Jul 1 '11 #1
0 1409

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Pablo | last post by:
Hi, there, I have a table which has a field (Email) populated with Email address. I am trying to send email using MS Outlook to those addresses. Everything works fine except that a warning message...
3
by: Nicola | last post by:
When using the NewMail.Body object, ! and spaces are being added into the email after the email has been sent. Has anyone else had this problem or even better a solution??
1
by: VB Programmer | last post by:
I am making a simple VB.NET app to send emails. I put a test button on the form with code like this: Imports System.Web.Mail : Dim msgEmail As New System.Web.Mail.MailMessage With msgEmail...
4
by: jerry.ranch | last post by:
I have a macro that autoruns once weekly and sends an email with an attached xls file ( a data extract) to some internal customers. The subject always reads , for example...is there a way to add...
1
by: yevgenia | last post by:
Hi there, I am developing an application in Access 2003 and need to send an email through Outlook based on the information entered on the form. Everything works except that the email is being sent...
2
by: assor | last post by:
hi i want to send email through my vb.net code and it send to all email(gmail,yahoo) except hotmail i dont know why?? note 1) i'm using outlook express 2) i send email using iis and virtual...
2
by: davidcm | last post by:
Last week, I found some code on-line that allows me to send email via SMTP from my VB 6.0 application. I had to add the Winsock control to the project and add the code that performs the SendData...
1
by: kumana1 | last post by:
This site is fantastic, first of all. Second of all, thank you for your time in this matter. I have been using some code that was posted on here (I apologize for not being able to remember who)...
11
by: rote | last post by:
I'm getting the email address from an excel sheet. But i need to send the email to multiple people When printing the below i get a@a.com;b@b.com;; But i want a@a.com;b@b.com; i don't need...
0
by: john breaker | last post by:
Hi, Why does the following code report the error: Error! The mail could not be sent Here is the link to an actual post(try for yourself please)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.