Using Access to obtain E-mail address

Status
Not open for further replies.
J

JIMC5499

I am working on an Access 2003 database to manage Engineering Change Notices.

A form is filled out and upon completion a folder is created and a .SNP file

is placed in the folder. When that is complete I am using a button to run an

Outlook event that sends an e-mail to the ECN Coordinator. The ECN

Coordinator's e-mail address never changes so it is coded. What I need is

the Originator's e-mail address to send them a copy.

In my database the Originator's address is entered in the ORIGINATOR_EMAIL

field. The section that generates the .SNP file sets the varible

strOriginator equal to ORIGINATOR_EMAIL with strOriginator being a Public

String varible. My Outlook code is as follows.

Dim objOutlook As Outlook.Application

Dim objEmail As Outlook.MailItem

Dim strCopy As String

strCopy = strOriginator

Set objOutlook = CreateObject("Outlook.application")

Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail

> To = "ECN Coordinator@mycompany.com"

> CC = strCopy

> Subject = "A New ECN has been created"

> Body = "A new ECN has been created and is ready to be entered"

> Attachments.Add strRetrieve

> Send

End With

I'm not getting any errors, but, the .CC e-mail isn't being sent.
 
K

Ken Slovak - [MVP - Outlook]

Is that address in the correct format? Does strCopy have the value you want

when you are setting the Cc value? Step the code and see what's happening.

"JIMC5499" <JIMC5499> wrote in message

news:450F812E-8C90-4CD1-8884-B406173F2B18@microsoft.com...
> I am working on an Access 2003 database to manage Engineering Change
> Notices.
> A form is filled out and upon completion a folder is created and a .SNP
> file
> is placed in the folder. When that is complete I am using a button to run
> an
> Outlook event that sends an e-mail to the ECN Coordinator. The ECN
> Coordinator's e-mail address never changes so it is coded. What I need is
> the Originator's e-mail address to send them a copy.
> In my database the Originator's address is entered in the ORIGINATOR_EMAIL
> field. The section that generates the .SNP file sets the varible
> strOriginator equal to ORIGINATOR_EMAIL with strOriginator being a Public
> String varible. My Outlook code is as follows.

> Dim objOutlook As Outlook.Application
> Dim objEmail As Outlook.MailItem
> Dim strCopy As String
> strCopy = strOriginator
> Set objOutlook = CreateObject("Outlook.application")
> Set objEmail = objOutlook.CreateItem(olMailItem)
> With objEmail
> .To = "ECN Coordinator@mycompany.com"
> .CC = strCopy
> .Subject = "A New ECN has been created"
> .Body = "A new ECN has been created and is ready to be entered"
> .Attachments.Add strRetrieve
> .Send
> End With

> I'm not getting any errors, but, the .CC e-mail isn't being sent.
 
J

JIMC5499

I keep getting "" as a value. My ORIGINATOR_EMAIL value comes up ,Out of

context wrote:


> Is that address in the correct format? Does strCopy have the value you want
> when you are setting the Cc value? Step the code and see what's happening.

> >

>

> "JIMC5499" <JIMC5499> wrote in message
> news:450F812E-8C90-4CD1-8884-B406173F2B18@microsoft.com...
> >I am working on an Access 2003 database to manage Engineering Change
> >Notices.
> > A form is filled out and upon completion a folder is created and a .SNP
> > file
> > is placed in the folder. When that is complete I am using a button to run
> > an
> > Outlook event that sends an e-mail to the ECN Coordinator. The ECN
> > Coordinator's e-mail address never changes so it is coded. What I need is
> > the Originator's e-mail address to send them a copy.
> > In my database the Originator's address is entered in the ORIGINATOR_EMAIL
> > field. The section that generates the .SNP file sets the varible
> > strOriginator equal to ORIGINATOR_EMAIL with strOriginator being a Public
> > String varible. My Outlook code is as follows.
> > Dim objOutlook As Outlook.Application
> > Dim objEmail As Outlook.MailItem
> > Dim strCopy As String
> > strCopy = strOriginator
> > Set objOutlook = CreateObject("Outlook.application")
> > Set objEmail = objOutlook.CreateItem(olMailItem)
> > With objEmail
> > .To = "ECN Coordinator@mycompany.com"
> > .CC = strCopy
> > .Subject = "A New ECN has been created"
> > .Body = "A new ECN has been created and is ready to be entered"
> > .Attachments.Add strRetrieve
> > .Send
> > End With
> > I'm not getting any errors, but, the .CC e-mail isn't being sent.


> .
>
 
K

Ken Slovak - [MVP - Outlook]

Well, only you know the setup of your Access database and tables, so you

need to populate that value so it gets applied to the Cc address of the

email.

"JIMC5499" <JIMC5499> wrote in message

news:02ACAD2D-7E10-4910-B758-028D093ECDE3@microsoft.com...
> I keep getting "" as a value. My ORIGINATOR_EMAIL value comes up ,Out of
> context>
 
J

JIMC5499

That's the problem I'm having. I'm using the ORIGINATOR_EMAIL field in the

record to provide the value for strOriginator, then I'm using strOriginator

to provide the value for strCopy. I have ORIGINATOR_EMAIL 's field set to

text. Is that correct for an e-mail address?
wrote:


> Well, only you know the setup of your Access database and tables, so you
> need to populate that value so it gets applied to the Cc address of the
> email.

> >

>

> "JIMC5499" <JIMC5499> wrote in message
> news:02ACAD2D-7E10-4910-B758-028D093ECDE3@microsoft.com...
> >I keep getting "" as a value. My ORIGINATOR_EMAIL value comes up ,Out of
> > context>


> .
>
 
K

Ken Slovak - [MVP - Outlook]

Yes, an email address is a string (text), but you indicated that you were

seeing a null string. Obviously that won't work.

"JIMC5499" <JIMC5499> wrote in message

news:BA619FE5-0149-43F0-A922-D84C9C0B1F3F@microsoft.com...
> That's the problem I'm having. I'm using the ORIGINATOR_EMAIL field in
> the
> record to provide the value for strOriginator, then I'm using
> strOriginator
> to provide the value for strCopy. I have ORIGINATOR_EMAIL 's field set to
> text. Is that correct for an e-mail address?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
G Adding a contact to Outlook with a custom form using Access VBA Outlook VBA and Custom Forms 1
M Modifying BCM Database using Access BCM (Business Contact Manager) 1
R how do I eliminate allow access dialog box using VBAproject in Out Outlook VBA and Custom Forms 1
R Outlook and Access integration using VBA Outlook VBA and Custom Forms 1
S Sending Email from Access 2007 through Outlook 2007 using template Outlook VBA and Custom Forms 13
R Trigger Application_ItemSend event when sending using Access macro Outlook VBA and Custom Forms 2
S Sending automatic email from Access using Outlook Outlook VBA and Custom Forms 1
R Using SendObject in Access to send an email Outlook VBA and Custom Forms 3
M Create email from Access on Outlook and make sure that email has beensent using WithEvents method Outlook VBA and Custom Forms 3
e_a_g_l_e_p_i Need clarification on 2-Step Verification for Gmail using Outlook 2021 Using Outlook 9
e_a_g_l_e_p_i Outlook 2021 not letting me setup my Gmail using pop Using Outlook 1
Geldner Problem submitting SPAM using Outlook VBA Form Outlook VBA and Custom Forms 2
O How to find out the domain and server settings that my Outlook is using? Using Outlook 2
S Outlook 2019 Custom outlook Add-in using Visual Studio Outlook VBA and Custom Forms 0
D Outlook 2021 Using vba code to delete all my spamfolders not only the default one. Outlook VBA and Custom Forms 0
M using excel to sort outlook appointment items Outlook VBA and Custom Forms 4
R Advise on using multiple instances of network files based on customers Outlook VBA and Custom Forms 8
HarvMan Using Emojis in Outlook 365 Using Outlook 3
T Outlook 2019 Not Using Auto Compete After Deletion of 365 Using Outlook 1
M USING INITIALS AS RECIPIENTS Using Outlook 1
T Outlook 2019 Using Gmail aliases in Outlook Using Outlook 6
M Saving emails using Visual Basic - Selecting folder with msoFileDialogFolderPicker Outlook VBA and Custom Forms 6
justicefriends How to set a flag to follow up using VBA - for addressee in TO field Outlook VBA and Custom Forms 11
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
I Outlook for Mac 2019 using on desktop and laptop IMAP on both need help with folders Using Outlook 1
David McKay VBA to manually forward using odd options Outlook VBA and Custom Forms 1
H Stationery using between OL 2019 and OL 2010 Using Outlook 0
P Prevent Outlook 2016 from using DASL filter Using Outlook 4
O Calendar - Location: what happens when using my own way of entering locations Using Outlook 1
M Disable Contact Card Results when using "Search People" in Outlook Ribbon Using Outlook 7
K can't get custom form to update multiple contacts using VBA Outlook VBA and Custom Forms 3
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
B Change Font and Font size using VBA Outlook VBA and Custom Forms 9
M Outlook 2013 reminder email by using Outlook vba Outlook VBA and Custom Forms 2
X Using Outlook 2013 and Outlook 365 Using Outlook 1
A Going to folder using shortcuts Using Outlook 3
A Outlook replies not using "delivered to" address in From Using Outlook 1
Terry Sullivan E-Mails Sent Using a Group Box Result in 70 Kickbacks Using Outlook 4
O Email not leaving Outbox when using Excel VBA to sync Outlook account Outlook VBA and Custom Forms 4
K Using Outlook 2016 to draw Using Outlook 1
O Outlook 365 - suddenly unable to send using Gmail POP3 Using Outlook 10
N Disable Auto Read Receipts sent after using Advanced Find Using Outlook 4
G Outlook 2016 sync contacts directly between phone and computer using outlook 2016 Using Outlook 0
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
O Save attachments using hotkey without changing attributes Outlook VBA and Custom Forms 1
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
A Edit subject - and change conversationTopic - using VBA and redemption Outlook VBA and Custom Forms 2
A Using or not using apostrophes in search terms has this changed? Using Outlook 0

Similar threads

Top