Private Sub Command22_Click() Process_Tasks2 End Sub Public Sub Process_Tasks2() Dim db As DAO.Database Dim rst As DAO.Recordset Dim qdf As DAO.QueryDef Set db = CurrentDb Set qdf = db.QueryDefs("Query3 - For Task Generation") Set rst = qdf.OpenRecordset() With rst Do Until .EOF 'Send E-Mail for each Record Debug.Print ![Shopping_Item] Call fnc1AddOutlookTask(![Shopping_Item]) .MoveNext 'Move to the next Record Loop End With rst.Close Set rst = Nothing Set qdf = Nothing Set db = Nothing End Sub Public Sub fnc1AddOutlookTask(Task_to_add) Dim OutlookApp As Outlook.Application Dim OutlookTask As Outlook.TaskItem Dim olTempFolder As Outlook.MAPIFolder Dim myApp As Outlook.Application Dim myNP As Outlook.NameSpace Dim myRecip As Outlook.Recipient Dim TaskFolder As Outlook.Folder Dim myTask As Outlook.TaskItem Set OutlookApp = CreateObject("Outlook.Application") Set OutlookTask = OutlookApp.CreateItem(olTaskItem) With OutlookTask ' .Subject = "This is the subject of my task" .Subject = Task_to_add '.Body = "This is the body of my task."
A client of mine was once convinced that despite my advice, nothing short of forensic recovery would put his old data at risk when he decided to donate some old workstations to a youth hostel. He wanted me to just delete the partitions the OS was sitting on, format and reinstall Windows. I did that on one machine right in front of him. Then I asked him to give me a few hours with that box on my own.
I returned the machine to him several hours later, with PDF copies of a few of "his" clients Tax Returns (complete with Tax File numbers) and a variety of other highly sensitive data sitting on the computer's desktop ready for the reading on a freshly installed copy of Windows 7 Pro. The entire exercise took about 4 - 5 hours, less than 30 minutes of actual hands-on work on my part. He was so grateful for my taking the time to show him what he was risking that I scored a $200 voucher to a high-end restaurant in Melbourne on top of my fee. Some people just need to physically "see" the proof of the pudding in order to believe.