I'm updating a database that automatically sends an email to the drafts folder of Outlook. The developer that created the database used VBA code to call html code written in a table. The html code contains the body of the letter. I've figured out most of it but I need to include a date (one month from the current date) in the body of the letter. Unfortunately I've been researching java script and html all weekend and still haven't managed to figure that one out. Can anyone out there help with this? Also is this normal to include html and javascript in Access, I have never seen it before. Are the benefits good? I have serious studying to do if this is the case.
The following link is where I am sourcing how to do it, however no matter what I do within my VB, the email comes up with about a full inch worth of an indent on the UL.
And then further down in the body where the UL is called
Code: "<p><ul><li>Print this email and return it with your shipment.</li><b>OR</b><br><li>Include your Dealer Number, Serial Number and Claim Number with your shipment.</li></ul></p>"
No matter what I change, the indentation doesn't move. See below...
I have a database to send e-mails from access trough Outlook. The issue is that I would like the body of the e-mail to have hyperlinks, colours, bolds and that I can get it from plain text.
This is the code I have:
Dim MyDB As Database Dim MyRS As Recordset Dim MyTable As Recordset Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment
[Code] ....
How can I make the body to be HTML format, or, can I have a e-mail template storaged in my PC and then indicate to use it whenever the e-mail is sent?
My company recently upgraded our MS Office from 2007 to 2010 (except for Access).
Previously, when I had Access 2007 and Outlook 2007, I had a process that generated 50+ dynamic emails from an Outlook template file (.oft).
The code would loop through a listbox and replace the template's default text to a string of text specific to the selection in the listbox by utilizing the Replace() function on the MailItem .HTMLBody.
Since the upgrade to Outlook 2010, the code is able to run, however, the Replace() function is no longer working; Instead, each email that is generated maintains the template's default text.
The only thing that is not working is the Replace() function, all other aspects of the code work fine.
I've provided a simplified version of the code below:
Dim myOlApp As Outlook.Application Dim objMailMessage As MailItem Dim stBody As String Set myOlApp = Outlook.Application Set objMailMessage = myOlApp.CreateItemFromTemplate("C:UsersDesktop emplate.oft")
[Code] .....
I've recreated the template file in Outlook 2010, thinking that the template created with Outlook 2007 would be the culprit, but to no avail.
What could have changed from Outlook 2007 to Outlook 2010 that would render my previously valid code ineffective?
Are there certain references I need to enable in both Access and Outlook to allow VBA in Access modify the content in an Outlook email?
I currently have a database which logs issues that come in to me from the business. The database has been designed to keep all stakeholders informed of there request and for the user to write to the stakeholder with a responce through Access. (The reason for this is so the database keeps track of all responses sent back to the stakeholder.)
However even though i am using a memo box the database will only send about 255 characters and no more. I understand this is the max value for a text box however this should not be the case for a memo box. :eek: :confused:
Is there anything i can do i am currently using the following code:
Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields ' Set the CDOSYS configuration fields to use port 25 on the SMTP server. With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort 'ToDo: Enter name or IP address of remote SMTP server. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "usahm204.amer.corp.eds.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 .Update End With ' Build HTML for message body. strHTML = "<HTML>" strHTML = strHTML & "<HEAD>" strHTML = strHTML & "<BODY>" strHTML = strHTML & "This is an automated e-mail to let you know that <b><font color=#FF0000>" & [Name of Requestor] & "</b></font> from <b><font color=#FF0000>" & [Department of Requestor] & "</b></font> has submitted a new <b><font color=#FF0000>A/R " & [A/R Code] & "</b></font> request in PERD." strHTML = strHTML & "</BODY>" strHTML = strHTML & "</HTML>" ' Apply the settings to the message. With iMsg Set .Configuration = iConf .To = "<Carol.Patukonis@examhub.exch.eds.com>" 'ToDo: Enter a valid email address. .Cc = "<Elisa.Chandler@examhub.exch.eds.com>;<Deborah.Davis@examhub.exch.eds.com>" .Bcc = "<Carlene.Vitello@examhub.exch.eds.com>;<Jason.Boney@examhub.exch.eds.com>" .From = "PERD Request<Jason.Boney@eds.com>" 'ToDo: Enter a valid email address. .Subject = "New A/R " & [A/R Code] & " Request" .HTMLBody = strHTML .Send End With ' Clean up variables. Set iMsg = Nothing Set iConf = Nothing Set Flds = Nothing '==== A/R 60 Code End ====
I have tried using .Priority = "High" and .Importance = "High", but I keep getting an error stating this object property is invalid. What can I use to set a priority (Low, Normal, High) on the e-mail using the above code?
I am trying to modify the following code to send an automated e-mail using Microsoft Outlook instead of Lotus Notes. We recently switched e-mail clients and now the older code does not work. I have tried to comment in all areas to indicate where the new Outlook code has been inserted.
Private Sub SendEmail(ByVal Subject As String, ByVal Body As String) 'The bulk of this code for Lotus Notes comes from this website: Dim copy(100) As Variant Dim strSQL As String Dim rsTemp As Recordset Dim Maildb As Object 'The mail database Dim UserName As String 'The current users notes name
Ive recently developed in Emailing from Microsoft Access. When I was researching email methods from Access a thought occurred to me that there should be an A.P.I. that would do this the easy way.All of them did have a web A.P.I. which was all I needed to translate a web request from the other language examples given.
Code: Dim reportName As String Dim path As String Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject") Dim oFile As Object Dim strAttachments As String Dim strTransPort As String Dim byteData() As Byte
Any way to enable the user to send an email via access?
I would like to add a "Report Bug" button to my main form where the user is able to type a description of a bug that they encountered and it will be sent to my email.
I'm not sure if this is possible. If not I could always resort to storing these bugs in a table instead.
We are currently using Access 2007 and I've got a database that sends emails out to multiple users depending on the data that was entered. We are about to upgrade to Access 2010 and I am testing it now. I was originally getting runtime error '287' when I was adding addresses to a Recipient object. I got past that by adding the addresses in a string and concatenating. Now I'm getting the error with .Send.
I am able to export data to excel file, I would like to send the excel file created to the customer, is there a sample code I can use to do this in a module.
I created a Tracking System and would like to send an automatic reminder to the person the ticket has been assigned to, using the due date and the text message in the field "reminder message". Once the message send, I want the database to recognize and not send it again. I want the database to send a new message if the due date has changed.
I'm trying to use Access to send an automatic email reply upon receiving a request from a customer/employee, telling them that their request has been received and this is the tracking number and the due date of service completion. How can I do that? And I want it using Outlook because all the contacts are saved in Outlook and all emails sent and received through Outlook. And the version is Access 2010.
I have a requirement to send a email to individual clients via my access database 2003 . I am using the email address of the client in the current open form . I then created a query using the id to filter that particular client, this query then becomes my record set.The content for the email is held in a .txt file , On my c drive . Every things appears fine however the fonts that I select in the .txt file are not being use in the actual email body. I created a word document with my preferred fonts and copied and pasted them into the .txt file but on sending the email the selected fonts do not appear.
I have attached a demo of what I am trying to do . To test enter your own email in the email address field of the form . Note the .txt file is on the C:/ drive.
I would like to automate the current process of sending an e-mail with a PDF attachment that is unique to each recipient; it is their test results. I'm sending an e-mail one at a time (which was fine when the number of folks being tested was small, but now I'm up to approximately 200 e-mails and growing each year)
System Environment:
Windows 7 SP1 (64 bit) Office 2010 Professional
Access environment and Process:
1. A qry object/letter is built based on 4 tables (test results, result averages, a global employee list and location)
2. The Report has both static and dynamic text. Examples include: "Dear" [qry-Letter. F_name] and Address Information
a. =[qry-Letters.F_Name] & " " & [qry-Letters.L_Name] b. =[qry-Letters.Position] c. ="Dept " & Right([qry-Letters.Dept],3) & ", " & [qry-Letters.City]
3. The report also includes the employee's results, the session averages (testing is conducted at multiple locations each occurrence is a session) and companywide averages.
4. Report Process: Run the report, entering primary key Emp_ID, report is populated saved (overwritten with the next Emp_ID and printed as a saved PDF.
5. MS Outlook: create a new e-mail, text body is common to all e-mails e.g. "attached are your test results" the PDF is attached and the e-mail sent to the recipient (the e-mail address follows the corporate standard, =Trim([qry-Letters.F_Name] & "." & [qry-Letters.L_Name] & "@abc.com")
I have Access 2013, Win 7, Outlook 2010 (32-bit).I want to send an email from Access, but not through Outlook. Instead I want to connect to an external SMTP server. I've found a few examples that doesn't work for me. With code including for example
Code: Set ObjMessage = CreateObject("CDO.Message")
I get an "Error 429: Object can't be created in Active X-component" (My translation from Swedish).With code including this:
Code: Dim oEMail As New CDONTS.EMail
I get "user defined type has not been defined" (my translation again).I have working code for sending email through Outlook, which works fine. But, Outlook adds a lot of span tags, making it impossible to read for certain screen readers used by visually impaired people, therefore I can't use Outlook.
I've tried to read up on the matter (CDO), and think that maybe the CDO library etc is not included on my computer?can I download it?
I've setup a selection form that returns a specific list of email addresses in a query.
What I can't work out is how to press a button and have the email addresses populate the To: field in a blank Outlook email - I don't need any bells or whistles.
I have a query (Access 2007) that contains a field named "email" (which contains email addresses, of course). I want to email everyone in the query and they are all going to receive the same message. My email to them doesn't have to be personalized and I don't need to collect data from the recipients. I don't even need a reply to the email I send.
I have a database that I can use to create a query, grouping companies by city. I then want to send a specific email I have created in outlook to all of the email addresses in the query.I do not need to include names.
I can create PDF's, DOCX's retaining the PDF formatting save them back to different network locations and then retrieve and attach to emails that are generated for different areas, however I have been asked to scrap the attachment and insert the content of the attachment directly into the body of the email. I have had a good browse around the net with no real approach. The code below simply gets the recepients email address adds the subject and then is looking for the .HTMLBody which simply comes through in the body as
"O:divAKLResgroupE - ReportsHTML FilesDRAFT TEST .html".
my html template is built inside access.. the form button is clicked and the template opens in outlook.
it looks fine in outlook.. so i send the email.. when i receive the email in outlook, it looks fine..
here is what it looks like
http://www.londonheathrowcars.com/image2.jpg
however, i sent the same template to a gmail and hotmail address to see what it looks like..
it looks fine in hotmail http://www.londonheathrowcars.com/image3.jpg
however in gmail it looks like this..
http://www.londonheathrowcars.com/image1.jpg
now, these gaps are appearing in between tables..
<table>blablabl</table>GAP<table>...
now, my question is.. is there anything i can add to the code that will remove these gaps.. i know my code is messy.. at the moment however it begins with <table> and ends with </table> (the main wrap table)
i realise i may need to add some kind of html type or something, but i dont know what..
as always, if anyone can shed some light on this matter i would be ever grateful..
thank you
below is the code
CODE Option Compare Database
Private Sub emailbutton_Click() 'References: Oulook Library Dim strEmail, strSubject As String, strBody As String Dim objOutlook As Outlook.Application Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application") Set objEmail = objOutlook.CreateItem(olMailItem)
I am using the following vba code to create and send an html format email message. The key information in the email is a hyperlink to a network drive folder location using [Directory] as a hyperlink table value to get the address that is stored like this: K:PipelinesP9 - TEP ProductsMOP AID-1500Final Approved
The email hyperlink that is produced looks like this:
#K:PipelinesP9_-_TEP_ProductsMOP_AID- Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem Dim MOPVDB As String MOPVDB = "H:PGADSBYMOP VALIDATIONTRACKINGMOPVDBMOP Validation DatabaseFE.accdb" Set appOutLook = CreateObject("Outlook.Application")