B
Bre-x
Hi,
I have a function on MS Access to export data into outlook
I would like to move to MS Outlook, so that I can importa data
Could you help me to modify it?
Function send_data()
Dim olApp As Outlook.Application
Dim Tsk As Outlook.TaskItem
Dim rst As Recordset
On Error Resume Next
Set olApp = New Outlook.Application
Set rst = CurrentDb.OpenRecordset("SELECT QIT_Tasks.* FROM QIT_Tasks;")
rst.MoveFirst
Do While Not rst.EOF
Set Tsk = olApp.CreateItem(olTaskItem)
With olApp.Application
'-----------------------------------------
Tsk.Subject = rst!tasksubject
Tsk.DueDate = "07/14/2009"
Tsk.Categories = "My Category - Test "
Tsk.Body = "This is the Body - Test" & Chr(10) & "Line 02 -
Test"
Tsk.ReminderTime = "07/13/2009 10:30 AM"
Tsk.ReminderSet = True
Tsk.UnRead = True
Tsk.Save
'-----------------------------------------
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE IT_Tasks SET status = -1 WHERE
task_id=" & rst!task_id
DoCmd.SetWarnings True
End With
rst.MoveNext
Loop
rst.Close
Set Tsk = Nothing
Set olApp = Nothing
End Function
I have a function on MS Access to export data into outlook
I would like to move to MS Outlook, so that I can importa data
Could you help me to modify it?
Function send_data()
Dim olApp As Outlook.Application
Dim Tsk As Outlook.TaskItem
Dim rst As Recordset
On Error Resume Next
Set olApp = New Outlook.Application
Set rst = CurrentDb.OpenRecordset("SELECT QIT_Tasks.* FROM QIT_Tasks;")
rst.MoveFirst
Do While Not rst.EOF
Set Tsk = olApp.CreateItem(olTaskItem)
With olApp.Application
'-----------------------------------------
Tsk.Subject = rst!tasksubject
Tsk.DueDate = "07/14/2009"
Tsk.Categories = "My Category - Test "
Tsk.Body = "This is the Body - Test" & Chr(10) & "Line 02 -
Test"
Tsk.ReminderTime = "07/13/2009 10:30 AM"
Tsk.ReminderSet = True
Tsk.UnRead = True
Tsk.Save
'-----------------------------------------
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE IT_Tasks SET status = -1 WHERE
task_id=" & rst!task_id
DoCmd.SetWarnings True
End With
rst.MoveNext
Loop
rst.Close
Set Tsk = Nothing
Set olApp = Nothing
End Function