Access Working With Outlook

Mechele

Registered User.
Local time
Today, 16:58
Joined
Jan 25, 2002
Messages
121
How can I get Access to activate Outlook and create a email with task assigned to specific people to complete or they will get a reminder until they complete the task?
 
Take a look at the SendObject method. Works well with Outlook.
 
Use this code behind a button on your form.

You will need to modify it to reference your fields though.

Private Sub Command1_Click()
On Error GoTo ErrProc
Dim TaskNS As Outlook.NameSpace
Dim TaskItem As Outlook.TaskItem
Dim TaskApp As Object
Dim Db As DAO.Database
Dim Rst As DAO.Recordset


Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Action")
Set TaskApp = CreateObject("Outlook.Application")
Set TaskNS = TaskApp.GetNamespace("MAPI")
Set TaskItem = TaskApp.CreateItem(3)


With TaskItem
.Subject = Rst.Fields("FieldName")
.Body = "The following meeting action will be added to your Outlook Task List"
.DueDate = Rst.Fields("FieldName")
.Recipients.Add (Rst.Fields("FieldName"))
.Assign
.Send
End With

Db.Close
Rst.Close

Set Db = Nothing
Set Rst = Nothing
Set TaskApp = Nothing
Set TaskNS = Nothing
Set TaskItem = Nothing

EndProc: Exit Sub

ErrProc:
MsgBox Err.Description
Resume EndProc

End Sub
 

Users who are viewing this thread

Back
Top Bottom