Email a reminder inAcces VBA

B

bzeyger

I am working on a project management Database. I would like to have a button
that will email myself a reminder to complete a task in a week. Is this
possible. The database is set up with users and permissions. Is it possible
to associate and username logged in with an email address. It does not have
to be complicated. I would just like to email a reminder to complete a task
in a week or so.
 
T

Tom Wickerath

Is it possible to associate and username logged in with an email address.

Yes, this can be set up. A table of people, with email address as an
attribute (field), can also include the person's NTUserID as another
attribute. VBA code can be used at startup to determine the user's NTUserID,
and match this to the appropriate record in the people table, so that you can
grab the correct e-mail address.

I have a sample database that I am willing to share with you, but I do not
currently have it available for download. If you are interested, send me a
private e-mail message with a valid reply-to address. Use the same subject as
this thread. My e-mail address is available at the bottom of the
contributor's page indicated below.

Please do not post your e-mail address (or mine) to a newsgroup reply. Doing
so will only attract the unwanted attention of spammers.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
L

Lance

I threw together a couple quick examples of automating outlook from vba, hope
it helps.

Sub send_mail(MAIL_SUBJECT As String, MAIL_TO As String, MAIL_BODY As String)
Dim outlook_app As Outlook.Application
Dim mail_item As Outlook.MailItem

Set outlook_app = CreateObject("Outlook.Application")
Set mail_item = outlook_app.CreateItem(olMailItem)

mail_item.To = MAIL_TO
mail_item.Body = MAIL_BODY
mail_item.Subject = MAIL_SUBJECT
mail_item.Send

Set mail_item = Nothing
Set outlook_app = Nothing
End Sub

Or you could just assign yourself a new task

Sub add_task(TASK_SUBJECT As String, TASK_BODY As String, TASK_DUE As Date,
TASK_REMINDER_TIME As Date, TASK_OWNER As String)
Dim outlook_app As Outlook.Application
Dim task_item As Outlook.TaskItem

Set outlook_app = CreateObject("Outlook.Application")
Set task_item = outlook_app.CreateItem(olTaskItem)

task_item.Body = TASK_BODY
task_item.DueDate = TASK_DUE
task_item.ReminderTime = TASK_REMINDER_TIME
task_item.ReminderSet = True
task_item.Subject = TASK_SUBJECT
task_item.Owner = TASK_OWNER
task_item.Save

Set task_item = Nothing
Set outlook_app = Nothing
End Sub
 

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