473,749 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AUTOMATE EMAIL ADDRESS IN ACCESS?


I have an email macro setup (maybe I should go another way, but that
was the quickest at the moment...) and what I would like to do is
automate the "to" addressee of the email it generates for sending.

What I have is an email button that creates a report based on a
property address on a form (driven by a query which has criteria such
as forms!frmPROPER TY!address). That open form also has an email
address on it for the owner, and I would like that very same button to
also reference the email address on the form and automatically populate
the email when it opens (Outlook). Within the Access macro, I can
stipulate the subject line and the text and that works fine. How can I
get it to also reference the email address on the form?

Scott Baird

Nov 13 '05 #1
3 2577
Check this out.

http://www.peterssoftware.com/c_emfa.htm

Nov 13 '05 #2
Thanks, but not quite what I'm looking for. This allows me to send TO
the same person each time. In my scenario, each record has it's own
email address (one property, name, phone, email address, is on the
screen at a time). I need to be able to send to various email
addresses (whichever one is on the screen at the time) with a push of a
button.

I can declare my subject line. I can even declare a few lines of text.
How can I declare the desired email address based on the contact
person's email addy?

Nov 13 '05 #3
> Thanks, but not quite what I'm looking for. This allows me to send TO
the same person each time. In my scenario, each record has it's own
email address (one property, name, phone, email address, is on the
screen at a time). I need to be able to send to various email
addresses (whichever one is on the screen at the time) with a push of a
button.

I can declare my subject line. I can even declare a few lines of text.
How can I declare the desired email address based on the contact
person's email addy?


The routine below is in a database where each record has a subform datasheet
with a list of associated email addresses. Users can enter a comment after
each email address if desired like this:

so*********@som edomain.com # this is Joe's home email address

double-clicking on the email address in the datasheet opens and addresses an
email to that address. With a little code you can extend this to do other
things. A good site for reference is http://www.slipstick.com/

Private Sub E_mail_Addresse s_DblClick(Canc el As Integer)
'Required reference: Microsoft Outlook 11.0 Object Library
On Error GoTo HandleErr
Dim strEmail As String
Dim olapp As Outlook.Applica tion
Dim olmi As Outlook.MailIte m
Dim j As String
Set olapp = GetObject(, "Outlook.Applic ation")
strEmail = Me![E-mail Addresses]
j = InStr(1, strEmail, "#", 1)
If j Then strEmail = Trim$(Left(strE mail, j - 1))
Set olmi = olapp.CreateIte m(olMailItem)
olmi.Recipients .Add strEmail
olmi.display
Exit_Here:
On Error Resume Next
Set olmi = Nothing
Set olapp = Nothing
Exit Sub
HandleErr:
Select Case Err.Number
Case 94 'Invalid use of Null
'(when double clicking on blank field)
Case 287
Case 429
'if the mail item we are creating is sent, it will not leave
'the outbox unless Outlook is open. To make sure messages
'are sent immedaitely, outlook is opened here if it is
'not already open.
Call Shell(modOffice .GetOutlookPath )
Set olapp = New Outlook.Applica tion
Resume Next
Case Else
modHandler.LogE rr "frm0Email" , "E_mail_Address es_DblClick"
End Select
Resume Exit_Here
End Sub
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
1929
by: Geoff Cox | last post by:
Hello Is it possibel to automate the access time allowed to a folder? I am using .htpasswd etc and would like to give say 0.5 hour access to users so that they can sample documents available on the web site... Cheers Geoff
4
8386
by: deko | last post by:
I have an address form in Access 2003 that contains the usual address information such as AddressLine1, AddressLine2, City, State, etc... I would like to put a button on this form that feeds the address info into MapPoint, along with a fixed return address, and gets driving directions - or at least get a map of the destination. I have the MapPoint software, but have not used it. Will MapPoint provide driving directions, or just a map? ...
6
5596
by: John Galt | last post by:
Does anyone have working code to send a fax from VBA using Outlook.Mailitem? I have tried some examples I have found and they all simply try to use the Fax number as an e-mail address. Thanks in advance
4
2415
by: Chris via AccessMonster.com | last post by:
I have the challenge of needing to automate table creation. It doesn't end there the tables have to be created from one table that looks something like this... Email Source at@at.com EB no@no.com EN in@in.com EB at@at.com EN I have to create those tables based on grouped records in the Source field. So in this case i would...
16
48885
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use a commercial program such as Adobe Acrobat and its associated API. The technique uses Ghostscript and Redirection Port Monitor - two free programs for creating PDF documents provided free by Russell Lang. The actual automation requires VBA...
5
3651
by: TM | last post by:
I would like to write a little app in Visual Basic .net as an add-in to Outlook 2003 so that I can quickly get a list of contact names and email addresses, then when I click on a name or email address, I want to open a new mail message to that person. I don't want to send the message, just open a new blank email so that I can make it easier to send messages. Any idea how I could find out more about how to do this ?
15
11137
by: Karl | last post by:
Hi all, I regularly use FTP to place Self Extracting Zip files on the web for remote users to update their datafiles. Works very nicely. I have automated the creation of the initial zip file ( update.zip ), and can automate the FTP'ing of the SE zip file to the update site. I have, as yet, been unable to find a way of automating the creation of a SE zip file from the initial update.zip. I have performed a rather
3
1747
by: steverossiter | last post by:
Hi, This is pretty simple stuff but if anyone can point a novice in the right direction it would be appreciated. I have a bunch of URL's that point to files on the internet whose download I would like to automate. Normally, I would have to paste the address in Internet Explorer's address bar, click 'Save' when the File Download dialog box pops up and then indicate a local disk location when the Save As dialog box appears.
3
6028
by: chiinook | last post by:
I have built a fairly simple database to manage contact information for about 300 clients. Some of these have requested that I send them our publications by email rather than post. I have created a query which culls the names and addresses of these contacts. Then I export the result to a .csv file and edit it into a distribution list format ... (ie FirstName LastName <em...@domain.com>; ... etc.) Is there a way for me to automate this...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.