Exporting Names to Send an Auto-Email

G

Guest

I'm trying to get Access to automatically send an email to a supervisor when
a document is reviewed. The name is set up to be Lastname, Firstname, but
when it exports it to Outlook to send the email, it's set up as Lastname;
Firstname. I was hoping there was a way to keep the comma between the names
so Outlook can recognize the name and send the email. The line I'm using to
send the email from Access is:
DoCmd.SendObject , , , Supervisor, , , ReportNumber, "Report has been
updated and needs to be reviewed.", False
 
D

Dirk Goldgar

metrunec86 said:
I'm trying to get Access to automatically send an email to a
supervisor when a document is reviewed. The name is set up to be
Lastname, Firstname, but when it exports it to Outlook to send the
email, it's set up as Lastname; Firstname. I was hoping there was a
way to keep the comma between the names so Outlook can recognize the
name and send the email. The line I'm using to send the email from
Access is:
DoCmd.SendObject , , , Supervisor, , , ReportNumber, "Report has been
updated and needs to be reviewed.", False

So you're relying on Outlook to look up the name. I don't know if that
works, but if it does, you might try forcing the "LastName, FirstName"
combination to be enclosed in quotes, like this:

DoCmd.SendObject , , , Chr(34) & Supervisor & Chr(34), , , _
ReportNumber, _
"Report has been updated and needs to be reviewed.", _
False

Please let me know if that works.
 
G

Guest

That worked perfectly. Thanks for the help.

Dirk Goldgar said:
So you're relying on Outlook to look up the name. I don't know if that
works, but if it does, you might try forcing the "LastName, FirstName"
combination to be enclosed in quotes, like this:

DoCmd.SendObject , , , Chr(34) & Supervisor & Chr(34), , , _
ReportNumber, _
"Report has been updated and needs to be reviewed.", _
False

Please let me know if that works.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
T

Tony Toews

Dirk Goldgar said:
Great! I didn't know Outlook would look up names in the address book;
now I do. Thanks.

But I wonder what happens when there are five John Smiths? Or the
boss is the John R Smith? While John Smith is someone else totally
different?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
D

Dirk Goldgar

Tony Toews said:
But I wonder what happens when there are five John Smiths? Or the
boss is the John R Smith? While John Smith is someone else totally
different?

I suspect that Outlook will display the same resolution dialog you'd get
if had entered the name in the To: line of a new message and tried to
send it. But I don't know.
 
T

Tony Toews

Dirk Goldgar said:
I suspect that Outlook will display the same resolution dialog you'd get
if had entered the name in the To: line of a new message and tried to
send it. But I don't know.

And people will click OK and then say a very bad word or two as they
try to cancel the outgoing email to the lawyer for the opposing side.
<smile>

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
D

Dirk Goldgar

Tony Toews said:
And people will click OK and then say a very bad word or two as they
try to cancel the outgoing email to the lawyer for the opposing side.
<smile>

<G> No doubt.
 
K

Kyle

I don't know if this helps, but I have a similar event in my database,
where I have to send out an email reminder to all the primary
investigators in the database. Since we're talking a school of about
500 within a university that just happens to be the state's largest
private employer, we do have redundant names.

So I felt it was cleaner to incorporate peoples' email addresses within
the database, rather than depend on Outlook to find the correct Dr. Yu
out of 17 in the university's address book.
 
T

Tony Toews

Kyle said:
I don't know if this helps, but I have a similar event in my database,
where I have to send out an email reminder to all the primary
investigators in the database. Since we're talking a school of about
500 within a university that just happens to be the state's largest
private employer, we do have redundant names.

So I felt it was cleaner to incorporate peoples' email addresses within
the database, rather than depend on Outlook to find the correct Dr. Yu
out of 17 in the university's address book.

Agreed. Besides you'd have to be choosing the correct person each
time which gets rather tedious.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top