Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 6th, 2005, 04:24 PM
Authorized User
Join Date: Jun 2004
Location: Los Angeles, California, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automating Outlook Task

I'm trying to assign tasks to other users. I'm picking information off of a subform to make my message and provide the receprient's name. The receprient's email address is in a string.
Public Function AssignTask()
Dim myOlApp As New Outlook.Application
Dim myItem As Outlook.Outlook.TaskRequestItem
Dim myDelegate As Outlook.Recipient
'Information from subform
Dim strReciprient As String, strResponsibleParty As String 'These are the same person
Dim strProject As String 'ActionDescription
Dim strFacility As String
Dim strFrequency As String
Dim strDueDate As String
Dim frm As Form
Dim sfN As Form 'Program Notification SubForm

Set frm = Forms!frmMainEntry.Form
Set sfN = frm.[fctlNotifications].Form
If sfN.[ProgramID] = sfN.[txtID] Then

strProject = sfN.ProgramDescription
strFacility = sfN.Facility
strDueDate = sfN.DueDate
strFrequency = sfN.FrequencyOfService
strReciprient = sfN.EmailAddress
strResponsibleParty = sfN.ResponsibleParty
strSender = frm!txtWelcome
Exit Function
End If

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)

Set myDelegate = myItem.Recipients.Add(strReciprient)
If myDelegate.Resolved Then
myItem.Subject = "Notification Of Compliance Requirement"
myItem.Body = vbCrLf & vbCrLf & vbCrLf & _
"To: " & strResponsibleParty & vbCrLf & vbCrLf & vbCrLf & _
"This is to notify you that the requirement for " & strProject & " at the " & _
strFacility & " is due on " & strDueDate & "." & vbCrLf & _
strProject & " is required " & strFrequency & "." & vbCrLf & vbCrLf & vbCrLf & _
"Keep On Track With Safety" & vbCrLf & strSender
myItem.DueDate = strDueDate
myItem.ReminderTime = DateAdd("ww", -1, strDueDate) 'Remind 1 Week before Due Date.
myItem. Importance = (olImportanceHigh)
End If
End Function
MS Knowledge base

How do I use a variable for an e-mail address?

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add task in Scheduled Task programatically amitjoshipune C# 2 July 31st, 2008 05:42 AM
Sending Outlook Task thru Web Application gadhiav ASP.NET 1.0 and 1.1 Professional 9 March 5th, 2007 10:36 AM
Execute Task from ActiveX Script Task PorcupineRabbit SQL Server DTS 1 January 10th, 2006 12:37 PM

All times are GMT -4. The time now is 04:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.