Modules & VBA :: Open Email Without Filling Recipient?

Oct 31, 2013

I have the following code (which everyone uses) but I have a challenge.

I ONLY want to use two (maybe three) fields from the database! (Subject & Body... with the POTENTIAL of an attached document.

I want to fill in the "to" section AFTER the email is open. This will allow me to make changes if I need to before it is sent.

Here is the code I am trying to work with. (It should look familiar) but I can't get it to keep outlook open!

Code:
Private Sub SecondEmail_Click()
'open Outlook, attach zip folder or file, send e-mail
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

[Code] .....

View Replies


ADVERTISEMENT

Modules & VBA :: Email Only Going To First Recipient When There Are Multiple

Dec 12, 2013

I have created a database that auto emails and works well, my problem now is that though there are multiple emails to send to it is only sending to the first one. The way I have set this up is I have created a qry to combine all emails using Allen Brownes concatrelated in below

Code:
SELECT DISTINCT Left([Copy Of tbl_Depot]![Depot],3) AS Port, ConcatRelated("[Copy Of tbl_Depot]![ContactEmail]","[Copy Of tbl_Depot]","[Copy Of tbl_Depot]![Port]=""" & Left([Copy Of tbl_Depot]![Depot],3) & """") AS Email
FROM [Copy Of tbl_Depot];

I then link this to an append qry which becomes my data source

Code:
INSERT INTO tbl_dptem ( [Empty Return Location], [Container], ContactEmail, DepotEmSent )
SELECT qry_emdepot1.[Empty Return Location], ConcatRelated("[qry_emdepot1]![Container No]+chr(13)+chr(10)","qry_emdepot1","[qry_emdepot1]![Empty Return Location]= """ & [qry_emdepot1]![Empty Return Location] & """") AS [Container], qry_Portem.Email, qry_emdepot1.DepotEmSent
FROM qry_Portem RIGHT JOIN qry_emdepot1 ON qry_Portem.Port = qry_emdepot1.[Empty Return Location]
GROUP BY qry_emdepot1.[Empty Return Location], qry_Portem.Email, qry_emdepot1.DepotEmSent;

Below is the code I use to auto send emails and when I check it shows all email addresses in sent email but it is only going to the first recipient.. not sure what I need to do so all of them get it.

Code:
Sub EmDepot()
Dim Notes As Object
Dim Maildb As Object
Dim MailDoc As Object
Dim objNotesDocument As Object
Dim objNotesField As Object

[code]...

View 4 Replies View Related

Modules & VBA :: Adding CC Recipient When Sending Email

Feb 7, 2014

I have been able to create code to send email for my ticket system but now have a need to add an additional recipient. I would prefer this recipient to be add in the CC field. This email address will come from its own table. I have tried to figure this out myself but I can't get anything to work for me . I am fairly new to VBA and all of my experience is just through trial and error (mostly error). I have attached my original code below ....

Private Sub cmdMailTicket_Click()
On Error GoTo Err_cmdMailTicket_Click
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text

[Code] ....

View 1 Replies View Related

Forms :: Filling Textbox With Email IDs

Jun 11, 2014

I am building a form where user can send emails from the form. I have bound eTextbox (Textbox) with email ids (around 40 email ids) and bound check box (ChkEmailSelect) to select the email id in frmEmailSelect. It is a continuous form. I wish to add the check marked emails in another form (frmEmail) in a textbox (TxtTo) with ";".

Table Name: tblEmails
Email Field Name : SendTo
Checkbox Field Name: SelectToSend

View 3 Replies View Related

Modules & VBA :: Send Task To Recipient Using Late Binding

Oct 2, 2013

I am trying to send tasks to other people using access vba. I had used before in my database but was using early binding and now through version issues of office I am trying to recreate the code using late binding, however I am getting various problems with certain lines of code.

Primarily .datedue line I am getting run time error 438 object does not support

Below is my code:

Public Sub ASB5PostponedTask()
Dim olApp As Object
Dim olTask As Object
Dim olDateEnd As Date
Dim ToContact As Object
Dim olTaskOwner As String
olTaskOwner = "e.grainger"

[Code] .....

View 1 Replies View Related

Modules & VBA :: Open Outlook And Send Email

Feb 3, 2014

I'd like a command button to open Outlook and create a new email message with the To and Subject fields already populated with what I want, is there anyway to do this?

View 1 Replies View Related

Modules & VBA :: Button To Open Up Outlook Email

Jun 26, 2014

I would like to create a button that when pressed opens up an outlook email. The email address will be populated by one email address every time. I don't want it to automatically send as the body will need to be filled out by the user. It would be useful if the date and time it was sent could be recorded in the form somewhere too (would this be in a text box?).

View 3 Replies View Related

Modules & VBA :: Email Hyperlink / Attachment To Open Access File?

May 15, 2015

I have created an action log database that sends an email when a new action is entered. I would like to launch the database using a hyperlink in the email, but can't seem to get it to work. All users have a copy of the front end on their desktop, so whatever I add to the email needs to launch the front end for any user signed on to their own desktop.

This is what I have and it sends a hyperlink but I click it, I get an error saying it can't find the file. I don't know how to word the path name for any user?

With obMsg
.subject = "New action request for " & team
.To = people

[Code].....

View 14 Replies View Related

Modules & VBA :: Filling Combobox With SQL Data?

Oct 6, 2014

I have a select statement (AlphaName and StaffName are variables) in a module that woks fine, its been tested with a basic insert. what i want to do is get this result into a combo box without creating another table?

Code:
strSQl = "SELECT [Week No] FROM [" & AlphaName & "_Hours] WHERE [Alpha Name] = '" & StaffName & "';"
Me.Week_Cmb.RowSource = strSQl

View 7 Replies View Related

Modules & VBA :: Filling Combobox Dynamically

Jul 24, 2014

I have been spending all my today to fill a combobox dynamically, but have not been able yet.

I have a combobox and a pass-through query in access, which is working fine and fill the details into the combobox via data source. Now what I am planning to do is to update the combobox source as soon as value in a text box changes.

here is the code I am using, but it is not working:

Dim rs As Recordset
Dim qDef As QueryDef
Set qDef = CurrentDb.QueryDefs("get_data")
qDef.SQL = "SELECT Initial + ' (' + Name + ')' uws FROM EM.dbo.UW" _
& " WHERE lob = '" & addSingleQuotation(Me.CMB_LOB.Value) & "'"

Me.cmbUM.RowSource = qDef.SQL
Me.cmbUM.Requery

I also used Recordset, but did not work:

Set rs = CurrentDb.OpenRecordset("get_data")
Me.cmbUM.RowSource = rs!uws

View 2 Replies View Related

Modules & VBA :: Form Which Has Button To Email Data Out In Standard Email Message

Jan 15, 2014

I have a form which has a button to email the data out in a standard email message.

Private Sub Command60_Click()
Dim MyDb As dao.Database
Dim rsEmail As dao.Recordset
Dim sToName As String
Dim sSubject As String
Dim sMessageBody As String

[code]...

This works well enough, however, FIELDS 11 through to 16 contain the venue address. This is all we ll and good if every field of the venue address is populated. here are times when not all of the fields are populated, for instance, the address might only be 5 lines.I know I can do this using IIf statements on a report, but how can i achieve the same thing for the email.

View 6 Replies View Related

Modules & VBA :: Filling With Zeros For Two Decimals Places

May 1, 2014

I'm passing a few numbers on to Word and these should always appear with two decimal places, also if it's a whole number etc.

e.g.: 10 -> 10,00 or 9,8 -> 9,80

Depending on the regional settings, the decimal marker can be . or ,

View 4 Replies View Related

Modules & VBA :: Generate Multiple Email Messages To Different Email Addresses

Jul 16, 2014

I have made a query with the name "Confirmation" and it is setup like this:

Name trainee Email Training
John John@mail.com Tr one
Mary Mary@mail.com Tr two

I also made a button in a report with the title "Send Mail" now is my goal that if i press that button automatically multiple e-mail message's will be generated with data from people in that query. So if click on that "Send Email" button i want two different mails messages generated that will be send to John@mail.com and Mary@mail.com with in the mail body their data.

View 13 Replies View Related

Modules & VBA :: Specifying Email Address When Sending Email Via SMTP

Jan 19, 2015

I am currently using vb code to send an email in Access on the click of a button. I want the database user to be able to enter the recipient in a text box [ToEmail] which is on form [GroupStockProfiler]. However, I'm unsure how to put this into my code. I currently have the following which doesn't work (unless I put a specific email after 'To'):

Private Sub Command414_Click()
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoAnonymous = 0

[code]...

View 1 Replies View Related

Modules & VBA :: Add CC Email Addresses Into Automated Email?

Aug 3, 2015

I have an automated email system (Lotus Notes) in a Access database I have created and am looking for the code needed to add up to 3 c.c addresses into an email prior to sending automatically.

The code I have to send the email to the To: individual is all working but what code I need to add and where for the c.c addresses of which there could be 1, 2 or 3. The control for To address is EmailTo = CustCopyEmail The controls for the 3 c.c emails are cc_EmailAddress, cc_EmailAddress1 and cc_EmailAddress2.

Here's the code I have:

Private Sub SEND_CC_Click()
' Set up the objects required for Automation into Lotus Notes.
Dim Maildb As Object 'The mail database.
Dim Session As Object 'The Lotus Notes session.
Dim MailDoc As Object 'The mail document itself.
Dim UserName As String 'The current users Lotus Notes name.

[code]....

View 8 Replies View Related

Modules & VBA :: Filling Excel Template Cells / Save Then Send On Outlook

Jul 13, 2013

I have the code below which takes information from a form on access and sends it over to the correct place on an excel spreadsheet template. This works fine but I then need it to save and send on outlook.

The issue I am having is that the saved document is not attaching to the e-mail. The subject etc all work fine but the excel spreadsheet just doesn't attach. When I go into the folder I have specified for the document to be saved in it isn't there either. :0(

The code for the e-mail "callmail" function works perfectly for word documents but I don't know if it is different for an excel file.

Code:

Private Sub Command154_Click()
On Error Resume Next
Dim appExcel As Excel.Application
Dim wbook As Excel.Workbook
Dim wsheet As Excel.Worksheet
Set appExcel = New Excel.Application

[Code] .....

View 4 Replies View Related

Send 'Report' To Mail Recipient

Aug 18, 2004

I am trying to send an MS Access 'report' as an attachment to a mail recipient in rtf format without success. Everything seems to work fine except the 'send' button. Click away and nothing happens.... no error messages, no nothing. Any suggestions or tips on how to make this work?

Thanks...

View 2 Replies View Related

Error On SendObject Method - Unknown Recipient

Jul 11, 2013

I ran into this error message with the SendObject method. I'm getting the email address from the "username" environment variable. Our company generally uses the logon ID as the first part of everyone's email address, but there are some users that get this error: "Unknown message recipient; the message was not sent" Not only that, if two sendobjects are used one after the other, sometimes it sends to the first person and then the second one is set up to send a copy back to the sending user, it doesn't recognize the recipient that's logged on and is actually trying to send the email. That's the one that comes from the environment variable. But I've tried hard-coding the recipient and bypassing the variable altogether and it still generates the same error.

View 4 Replies View Related

Open An Email Template. Sorry If This Is Easy

Oct 30, 2006

Hi all, I have done a search to try and find an answer to this question but haven't found quite what i'm after.

I have an email template saved and all I need is a (hopefully very simple) command button that when pressed opens the outlook email template.

I don't need any addresses filled in or anything else like that, just the template to open.

Sorry if this is such an easy question to answer but i'm not that great with access but was still asked to find out a way of doing this.

If any better ideas can be suggested please do as i'm open for ideas.

Thanks for any help.

View 3 Replies View Related

Queries :: Word Recipient List Empty With Access Query

Sep 1, 2014

I have a query in Access and a word document that opens up the query. Currently the query contains every record in the database. If I alter the query in Access to select a certain set of records (based on dates) when Word opens the recipient list is empty. Checking for errors it says there were no records or no data records matched query options.

How can I get Word to open and use the modified query?

View 3 Replies View Related

Email Current Contact On Form/Open Outlook

Nov 3, 2004

I've researched all the email topics, but can't find what I am trying to do.
Most of these topics are talking about emailing a record or form or something.

I have a form that contains thousands of contacts address, telephone, email, etc.
I would like to create a button that on click would open Outlook and grab ONLY the
email of the current contact I am looking at on the form at that time and add that
email address to the [To:] box of a new email.

Thanks you guys, I'm learning...slowly, but it's coming.

View 4 Replies View Related

Using Create Email Button - Access Fails To Open Outlook

Dec 16, 2012

Occurs when I try using the Create Email button. I've enabled the access add in in Outlook. Same message comes up when Outlook is closed or open.

View 4 Replies View Related

General :: Macro To Email A Form Once Condition Met - Open Outlook From Access

Apr 10, 2013

I have a macro set to email a form to a person once a condition is met. This works fine but I've discovered that Outlook (2010) has to be open BEFORE this macro is invoked.

I wanted to add a step to the macro before the one that makes it email that basically says to open Outlook.

I have tried the RunApplication macro, but I apparently am not getting the path right. I don't understand what the problem is.

I accidentally dragged Outlook to my desktop and therefore created a shortcut from my Start Menu, but now when I go to Microsoft Office in my Start Menu, Microsoft Outlook isn't one of the options. I can't find the path to where it may reside now.

I am using the path to the shortcut on my desktop.

C:UsersJust MeDesktopMicrosoft Outlook 2010

What else am I supposed to do?

View 8 Replies View Related

Open File Msg (outlook) From Access With Double Click On Email Address

Mar 15, 2012

In an ACCESS DATABASE I have 2 fields

-email_address

-language

I want make double click on email_address field and open a specific files msg

example :

double click on gimec.roberto@gmail.com

if the language is ITALIAN open in OUTLOOK file ITALIAN.msg

if the language is RUSSIAN open in OUTLOOK file RUSSIAN.msg

View 1 Replies View Related

Modules & VBA :: How To Check If Email Was Sent

Nov 16, 2013

Sending email using VBA & HTML. I want send email from access. Message in body contains some text and table in HTML format. I need check if email was really sent or cancelled with user.

Code:
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
With objMail
'Set body format to HTML

[Code] ...

I need some message (for example):

If error then
MsgBox "Email not sent"
Else
MsgBox "Email sent"
End If

View 2 Replies View Related

Modules & VBA :: Email From Query

Oct 22, 2013

I have created something from our transport department and need to set up so he can select a command button and email from a query, but where would I put the query details in the coding below

VBA used

Dim strSQL
Dim db As DAO.Database
Dim MailList As DAO.Recordset
Dim objOutlook As Outlook.Application
Dim objemail As Outlook.MailItem
Dim Subjectline As String
Dim BodyFile As String

[code]....

View 1 Replies View Related







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