General :: HTML Body In Email Sent From Access

Sep 18, 2012

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?

View Replies


ADVERTISEMENT

Email HTML Body Code

Aug 27, 2015

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".

.To = RScoloumdetail(2) ' Gets Email Address
.CC = ""
.BCC = ""

[code]....

View 2 Replies View Related

Sending Reports With Email Body Having HTML

Nov 20, 2014

I need to send different reports to a bunch of different persons every hour... I had several macros that did it for me, But Then they wanted me to include a e-mail body that was more than 255chars, so i had to go VBA and i have this (for every set of persons and Reports):

Private Sub Command38_Click()
On Error GoTo ErrorHandler
DoCmd.SendObject acReport, "REPORT NAME", "Extension", "EMAILS", "", "SUBJECT", "EMAIL BODY", True, ""
ExitHandler:
Set rs = Nothing
Set db = Nothing
Exit Sub
ErrorHandler:

[code]....

so everything is good, but NOW they want the body of the email to contain another paragraph totally separated from the first one and they want it highlited and also in Red, How can i add Html to this or do i have to use another method?

I have tried this:

Public Sub TestEmail()
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")

[code]...

But it keeps on giving me errors, about objects not being defined.

View 14 Replies View Related

Modules & VBA :: Insert HTML File Into Body (inside Loop Email)

Apr 30, 2015

What I want to do is inset a html file into the body of the email . I have created a publisher file and saved as html ..say

C: estpub1.html

How do I get this in to the body ?

Code to date below (not the tidiest - but it works)

Private Sub Command0_Click()
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Dim OutApp As Object
Dim OutMail As Object
Dim strAttach1 As String

[Code] ......

View 9 Replies View Related

Modules & VBA :: Vanishing Commas When Exporting Report Into HTML Email Body

Jun 17, 2013

I'm running the following code to generate an email from a report.

Quote:

Function ExportHTML3()
Dim strline, strHTML
Dim OL As Outlook.Application

[Code].....

But I don't really know much VBA and I found that code on the internet, so I can't figure out how it's doing that and if I can stop it. Or is there another way to get the text from the HTML file into the Email body, which brings the bold formatting with it, like the following.

Incident Reference: AA99999

View 4 Replies View Related

General :: Access 2010 - Email Records In Body From Table

Oct 1, 2013

I've set up a piece of VBA code to loop through and email various recipients data, in the form of records within the email body. This works fine, but occasionally produces an error whereby the email output body lines are duplicated spuriously. This only seems to happen when running a large number of email loops.

The data source for the email body content is a table, which for each 'loop' is refreshed with new data by 1) deleting records from that table, and then 2) appending data to the table.

The portion of code for the loop & email:

Do
'Build outputbodytext
DoCmd.OpenQuery ("EmailQ2")
DoCmd.OpenQuery ("EmailQ1")
'set up email
Set rec2 = CurrentDb.OpenRecordset("outputbodytext")
strSendTo = rec2("Email")

[Code] .....

View 3 Replies View Related

General :: Moving Cursor Position In Email Message Body

Nov 14, 2012

Is there an automatic way of moving the cursor when an outlook email is opened using a VBA event??

Right had a look and haven't managed to google this yet but the background is as follows

I have some code that puts a recordset of people's email into outlook and leaves users with the outlook message open ready for them to append anything they want to the message body.

At the moment the cursor flashes at the very start of the message and users need to scroll down with keys or the mouse to the end before they can add additional text.

I want to automatically move the cursor to the end of the outlook email message opened using a VBA event?

View 3 Replies View Related

Bold Within Email Body Generated Within Access

Nov 21, 2006

Hey, I was wondering how I would tell Access to set bold on my email message. I use this code to generate the email:


Private Sub Email_Click()

strToWhom = [EMAIL]

strMsgBody = "This is my email body, I would like this word bold"

DoCmd.SendObject , , , strToWhom, , , "Subject", strMsgBody, True

End Sub

Thanks for any help provided.

View 2 Replies View Related

Modules & VBA :: How To Import Email Body Into Access Table

Sep 11, 2013

I want to import email data into my access table. The email format is always same and the fields in the email match with the fileds in my table.

View 1 Replies View Related

Access 2010 - VBA Code - Add Report To Body Of Email?

Feb 25, 2013

Access 2010 - add report to body of an email

i have VBA code to create an email and attach an excel file, what i would like is code to add a report called REPORTMISSINGDATES to the body of the email.

this is the code i have so far, which works and adds everythng i wqant except the main body of the email.

Private Sub Command31_Click()
On Error GoTo Command31_Click_Err
Dim Email As String
Dim name As Variant
Dim EMPloy As Variant
Dim month As Variant
month = MonthName([Forms]![STAFFATTENDANCEMenu]![StaffMonth])
EMPloy = Forms!staffattendancezone!Staff
name = DLookup("[STAFFNAME]", "[QRYSTAFFNAME]", "[ASA] = Forms!staffattendancezone!Staff")
Email = (Forms!STAFFATTENDANCEAdjust!Email)
DoCmd.SendObject acQuery, "STAFFATTENDANCEZONECheckEmployee", "ExcelWorkbook(*.xlsx)", [email], "", "", "" & "Attendance Errors", "THIS IS WHERE I WANT THE REPORT TO GO" _
End Sub

View 1 Replies View Related

Modules & VBA :: Email From Access Form - Random 0 Appear In Message Body

Jun 15, 2014

The code works perfectly except that a random "0" appears in the body of the email. How to correct the code to remove this annoying little "0"?

Private Sub Command62_Click()
Dim strSubject As String
strSubject = Me.LoadNo
DoCmd.SendObject _

[Code] .....

View 1 Replies View Related

VBA To Send Email From Access - Table Pasted In Message Body

Aug 11, 2011

I want to be able to send email and in the body i want the my table be pasted in email body...

Is that possible?

View 3 Replies View Related

Access Uses HTML To Send Email, Please Help

Aug 29, 2004

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.

View 1 Replies View Related

Forms :: Using HTML To Format Body In Send Object Method?

Jun 26, 2014

Can I use html to format the message body in send object method ? If I can, how to do that.

View 5 Replies View Related

Forms :: Add Senders Email Address To Body Of Email

Sep 16, 2013

I want to automate an email to include the senders email addres with some text in the body of the email.

Code:
Private Sub send_mail_Click()
Dim olApp As Object
Dim objMail As Object
On Error Resume Next 'Keep going if there is an error
Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open

[Code] ....

View 3 Replies View Related

Modules & VBA :: Replace Function In Access 2007 For HTML Email In Outlook 2010

Aug 4, 2014

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?

View 12 Replies View Related

Body Of Email

Nov 10, 2004

I'm wanting to use a cell from a table for the body of an email I am sending
I am trying to use the following code right now:

.Body =

but I'll change it if you have something better!
thanks

View 14 Replies View Related

General :: Publishing Access Database On Web - Convert To HTML?

Feb 1, 2013

I have small program in access database which contains about 100 cca tables, querys, forms, macros in total. Customer which both program from me, wants me to enable him to access this program not just from work, it wants to access it from home or when he is on business trip from hotel etc.

I am little confused how to achieve this and what are my options? I assume I have to set by database somewhere on server and so my customer could access it any time? Do I have to upsize access database to SQL express or similar?

Also, one more important question: is it possible to "convert" access database into HTML code or similar so it could be accessed via web browser without need to install microsoft access and with freedom that it can be opened from any type of PC OS (Linux, Mac etc)?

View 14 Replies View Related

Send Query In Email Body

Feb 27, 2006

I almost have what I need, but I am not quite there. I am a VBA novice and need help. I couldnt understand some of the code I have searched for on this topic.

I have a query that returns exactly the results I want. By using a SendObject macro I can accomplish sending the message with a .txt file attached. What I want to do is instead of having the attachment I want to send my query "FaxReportQueryReport" in the body of the email. No set address, just a set RE: line of "Today's Deliveries".

View 10 Replies View Related

Modules & VBA :: Include Query In Body Of Email

Jan 30, 2014

I have a query table in Access 2007 with requests pending an individuals review and approval. I would like to create an automatic email each day to that individual which includes the actual query table impeded as part of the body of the email (not as an attachment).

View 1 Replies View Related

Modules & VBA :: Using Query To Put Data In Email Body?

Apr 22, 2015

I'm trying to put multiple records of data from a subform in a single e-mail, and my Outlook calendar. I have a contracting business, and on my Orders form (which details a single client), I have a sub-form that lists all the items to be done at that client's home (a different record for each work item). When I send an e-mail, or post the appointment to the Outlook calendar, I am trying to list all those records in the body of the e-mail, and/or in the Notes section of the appointment. I created the query to call the records, but have not figured out a way to use it in the code.

View 14 Replies View Related

Modules & VBA :: Send Two Reports In Email Body?

Jan 15, 2015

With the code below , I send the report: “ESERT4H”, in email body. How I could add yet another report on the same body of the email ?

DoCmd.OutputTo acOutputReport, "ESERT4H", "HTML(*.html)", "D:Access empESERT4H.html", False, "", 0, acExportQualityScreen
Dim Out As Outlook.Application
Dim NS As Outlook.NameSpace
Dim Folder As MAPIFolder
Dim Mens As MailItem

[Code] ....

View 7 Replies View Related

Forms :: Copying Data Into Email Body

Jan 30, 2015

I currently have a form with the below fields (example names)

FRMFormName001

Field001
Field002
Field003
Field004

RPTReportName001

Once the info is filled out we click a button that converts it into a report and once the information is confirmed correct you have to click another button Email it off, this is currently done by a macro creating the report as a attachment PDF File.

The system has now changed and they now want the details in the body of an Email, is it possible to make the details be copied straight into an Email body by a simple macro button click or similar?

View 5 Replies View Related

Forms :: Any Way To Export A Form Into Body Of Email?

Mar 31, 2014

I made a form in Acces now i want to make a button in that form that if a user click on it it wel open a new email message with the form in it.. so NOT if a attachement but directly in the email body.

I'm sure there is a way to do this true vba or something else...

View 1 Replies View Related

Modules & VBA :: Adding NameStr In Email Body

Jul 16, 2014

NameStr As String

I have made a name string

Now I would like to add the nameStr near "Dear " how can i do this?

strbody = "<H3><B>Dear [I want the placed nameStr here] </B></H3>" & _
bodyStr & _
"<br><br><B>Thank you</B>"

View 1 Replies View Related

Adding Report Content Into Email Body

Jul 30, 2014

I am trying to work my way into putting the content of my report into the body of an e-mail. I have used the following code to do so but I keep on getting the error: "An Expression You Entered Is the Wrong Data Type for one of the Arguments"

Code:
Private Sub Command278_Click()
On Error GoTo ER
Dim db As Database
Dim rstOpenPurchaseOrders As Recordset
Dim strSQL As String

[Code] .....

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved