Modules & VBA :: Add Field Values In Subject And Body Of Mail

Feb 4, 2014

I have a script that sends a mail using outlook to a different person depending on a value in a field. I want to add values from fields to the subject and body of the mail it creates. This is what I have so far:

Function Mail()
On Error GoTo Mail_Err
If (Forms![Manage Packages]![Customer] = "MSC") Then
DoCmd.SendObject , "", "", "email", "email", "", "[ID] - [Package Name] - Delivered", "Dear," & vbNewLine

[Code] .....

In the subject and body the field ID's I want to add are marked as [ID], [Package name] etc.

View Replies


ADVERTISEMENT

Modules & VBA :: Unable To Capture A Newly Arrived Mail In Outlook With Respective Subject Line

Jul 14, 2015

I am trying to capture a newly arrived mail in outlook with respective subject line. The below code works for me on 2010 outlook but when new mail arrive in outlook 2013 ,Mrthod Items_ItemAdd do not get called.

Code:

Option Explicit
Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Set olApp = Outlook.Application
Set objNS = olApp.GetNamespace("MAPI")
' (1) default Inbox

[Code]...

View 10 Replies View Related

General :: Bulk Mail Send With Different Mail Body Contents

Apr 26, 2013

I have a ms access table with two fields...tablename is ..."Addresses"..

Field1:= Employee_mail_id
Field2:= Leave_balance

What I need to do is that,I need to send individual mail (in Bulk) two each employee intimating their leave balances.
Is it possible to do it in vb .I want it to assign the codes in a button.

Below iss the code.

Dim r As Recordset
Dim email As String
Set r = CurrentDb.OpenRecordset("select * from Addresses")
Do While Not r.EOF
email = email & r(2) & ";"
r.MoveNext
Loop
r.Close
DoCmd.SendObject acSendNoObject, Null, Null, email, Null, Null, "Test subject", "Message body of the test letter", False, Null

View 2 Replies View Related

Send Report From Access In A Body Of An E-mail

Dec 13, 2006

Could you please help me and advise if it's possible to send report from MS Access by mail - having report as a content of an e-mail instead of attachement?

View 2 Replies View Related

Queries :: Pasting A Query In Outlook Mail Body

Jun 3, 2014

Is there a way to paste a access query result in the outlook message body?. I do not want to attach the query result in the email.

View 8 Replies View Related

Modules & VBA :: Edit Subject Line Of Outlook Email

Aug 27, 2014

I'm trying to write a line of VBA code (in an existing Access 2010 DB) that changes the Subject Line of all selected emails in my Outlook Inbox to today's date.

View 1 Replies View Related

Modules & VBA :: Update Subject Of Emails In Outlook That Have Already Been Received

Jul 22, 2014

I'm trying to automate some processes. My company uses Outlook 2010 and every day we need to go into our "Sent" folder and rename the Subject line of all of our sent emails. We change the subject to a standardized format depending on the content of the email and who the email was sent to. These are then used as part of an equation to tally our Transactions Per Hour. (TPH)

I've already designed a small Access 2010 utility to track the TPH, but I would like to add the functionality to parse some data from the subject lines of my "Sent" folder, and automatically make changes to save some time.

Here is my thought process:

- Click "Process Sent Emails" button from TPH utility.
- Access runs through each email in the "Sent" folder (or perhaps only selected emails) and changes the Subject line per simple Select Case criteria (I can figure that part out).

View 2 Replies View Related

Manual Auto Numbering Subject To Change In Date Field

May 18, 2006

Greetings everubody,

I've a problem and hope to get answers for,

The situation is that I have a table named patient and a form named [patient1] where it holds a textboxs named "MFC_Seq_no" and another to hold [date], now, I manged to do a manual auto numbering for "MFC_Seq_no" using the following VB :

Private Sub Form_Current()

If Me.NewRecord Then
On Error Resume Next
Me!MFC_Seq_no.DefaultValue = Nz(DMax("[MFC_Seq_no]", "Patient"), 0) + 1
End If

Whenever user create new record, the system will automatically store the next number in the new record.

Now, I've be requested to code that system to start again from 1 as value for "MFC_Seq_no" whenever there are changes in date field (i.e. next day in the date field)

Is this doable and how?

Q2. how to duplicate an entire record with a subform, from another table, in it?

Thanks,

View 2 Replies View Related

Mail Once Again - Opening 'new' Mail-window And Export Mail Adress

Jun 23, 2006

Hi, this is probably a very easy question for you Access-gods out there.

Ive made a database (MS Access 2000) with all my clients. I collect a lot of contact info, including e-mail.

I want to make a function which opens a new mail window (Outlook 2003) and automatically puts in the e-mail from my form (In the send-to field of outlook).

Is this possible? And how?

(BTW: Im a newbie with VBA)

View 2 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

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

Modules & VBA :: How To Display All Records From Report On Email Body

Nov 16, 2014

With this very simple command, I have the ability to send emails to several clients, reporting many things, quotations etc.

Private Sub Command84_Click()
DoCmd.SendObject , , , , , , "SOMETHING", [SalesGroupingField] & "" & [1], True, ""
End Sub

Now, i want, on the body of the emai, to display many records, it is from Nothwind, how can i display on the body of the email all records from this report?

View 10 Replies View Related

Modules & VBA :: Adding Report In Outlook Text Body

Aug 5, 2014

I have copied a VBA from the net and it is working fine and producing my report on outlook body text but one problem me facing is that it is pasting only first page if the second page is there it is not coming in outlook text body this what i want rest every thing is correct the code is:

Private Sub Command88_Click()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem

[Code] .....

View 5 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

Modules & VBA :: Count Of Serial Number In Email Body

Jul 15, 2013

I am attempting to modify some code that is used for reading content in an Outlook mail and need to catch and move the email if certain content is duplicated in the email.

The code reads the email that is in the attached image format:

As seen, this email contains 2 devices, but the Serial No in both is duplicated.

In the code, I need to capture this and rather than reading the contents, I need to just move this email to a separate "Manual" folder to be dealt with separately, so not to write the information to the database.

The current code is as follows:

Option Explicit
Private ns As Outlook.Namespace
Private sEmailAddress As String
Private sPerson As String
Private dReceived As Date

[Code] .....

View 4 Replies View Related

Modules & VBA :: How To Remove Default Signature From Message Body

Jan 13, 2014

I have created a form that allows the user to create an Outlook email message using a saved HTML template in VBA but the users default Outlook signature is added every time the message is sent.

how to remove the default signature from the message body?

View 2 Replies View Related

Modules & VBA :: How To Insert Carriage Returns In Body Text Of Email

Sep 9, 2013

I have developed a private sub which automatically creates an email when a button is pushed.

The code is working well, but I need to insert Carriage Returns in the Body Text of the email just before the word "Please" where it appears in two places. Is this possible?

The code for the private sub is below.

Private Sub PublishROI_Click()
On Error GoTo Err_PublishROI_Click
DoCmd.SendObject acSendReport, "PSR_Rcd_of_Investigation_Rpt_Publish", acFormatPDF, Me.txtEmail & ";" & Me.txtRMEmail, Me.StorageEmail, , _
Me.txtPSRNum, _

[Code] ....

View 3 Replies View Related

Modules & VBA :: Fetch Combobox Text In Email Body Of Outlook?

Apr 25, 2015

I am trying to fetch combobox dropdown text (in the networks label ) into the email body but in vain.

Whichever networks are selected in the six dropdowns should go to email body as you can find in the attachment ...

View 1 Replies View Related

Modules & VBA :: Body Of Outlook Email - Left Justify String

Mar 5, 2015

I have the following string of text that I currently push out to the body of an Outlook email (using the DoCmd.SendObject function with an Access report):

Code:
sMsgBody = "Please find attached the specified Final Costing Report for WO# " & WO & vbCr & vbCr
sMsgBody = sMsgBody & "Dealer: " & rs.Fields(0).Value & vbCr
sMsgBody = sMsgBody & "Model: " & rs.Fields(1).Value & " : " & rs.Fields(2).Value & " : " & rs.Fields(3).Value & " : " & rs.Fields(4).Value & vbCr
sMsgBody = sMsgBody & "Margin $: " & rs.Fields(5).Value & vbCr
sMsgBody = sMsgBody & "Margin %: " & rs.Fields(6).Value & vbCr

Which is great and works fine! It appears in the email like so:

Original.PNG

Now, it has been requested that the data to be left justified to the widest line... so, in this scenario, it would look like this:

Edit.PNG

I've searched for ways this might be accomplished so it's always left justified to the widest line, but haven't come across any definitive solutions yet.

View 9 Replies View Related

Modules & VBA :: Send Query Results In Table In Body Of Email

May 24, 2014

I have created some code to get the records of a query and it puts them in the body of the email but it doesn't format it well for example the email looks like

James | halliwell | 31
Leanne | smith |27
Alexis | smith |8

I would like it to be in a table is this possible,

Code:
Public Function SendEmail()
Dim MyDB As DAO.Database
Dim rst As DAO.Recordset
Set MyDB = CurrentDb

[Code] .....

View 3 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

Modules & VBA :: Sending Email - Carriage Return Not Working In Message Body

Jul 9, 2013

I am sending an email from a button, and it runs a word merge and then attaches that word document and two others two an email. All that works fine, but in the body of the email the carriage return is not working.

I've tried "vbCrLf", "Chr(13)" and "Chr(10)". but none of them are working in this email. I use vbCrLf all of the time in many other emails and it works fine.

Code:

Public Function SendEmailFinancial()
Dim MessageBody, vAttach1, vAttach2, vAttach3, vTo
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

[Code] ...

This is what the email is looking like when it comes out:

Project ID: 2013YG00229 Project Title: Toolbox Talks Construction Safety Guides and Mobile App Program Manager: Shana Peschek I am attaching three (3) forms that are needed in order for the State of Washington to process grant payments for your organization for the purposes of carrying out the activities outlined in your final approved application.

View 1 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 :: Create Image File From HTTP Request Response Body?

Oct 24, 2014

I'm working on a database which is designed to connect to an app called Canvas (www dot gocanvas dot com). It's for a client which runs a team of heating engineers. All the information regarding the engineer's job is uploaded to Canvas through their API as an XML file, and the engineers use an app on tablet to view the job details. When the engineer goes to their customer and does some work, the completed info (which parts were serviced etc) is then downloaded as an XML file via the API into the database. Also, the customer signs on the engineer's tablet to confirm that the work has been done.

Although the XML files for the job data upload and download fine, there's a different API for getting a download of the JPEG which contains the customer signature, and I'm having real problems finding out how to use this.

The API guide says this:
----
The Submissions API is restricted to authenticated users and requires a username and apassword to access. In addition, the ID field is required. If these fields aren't specified, an error is returned.

The result of this webservice invocation will be either a standard JPEG image or an error code.

Example: [URL] ....

All my code (which I've pasted at the foot of this message seems to work fine. There are no errors, and the ResponseBody object appears to contain a byte stream which would be the jpeg... if only I could get it into a jpeg file!

How I go about taking this "stuff" that's come back in the responsebody and actually create a jpeg image file from it? I feel that I'm so close that I can smell it, but can't get the last step!

Here's the existing code :

Code:
Sub DownloadImageFile()
Dim xhr As Object
Dim webServiceURL As String
Dim actionType As String
Dim PostData As String
Dim strResult As String

[Code] ....

View 7 Replies View Related







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