任务提醒非代表

时间:2017-08-20 07:59:34

标签: vba ms-access outlook

我正在开发Access中的任务提醒,以提醒相关员工完成关键任务。

我有一张表格,上面有关于截止日期的详细信息,我想将任务设置为特定员工的特定记录。

我可以将任务设置为我的Outlook。有什么办法可以将任务设置给其他用户的Outlook吗?

我想在不设置委托或共享文件夹的情况下完成此操作。

Dim outLookApp As Outlook.Application       
Dim outlookTask As Outlook.TaskItem     
Dim myDelegate As Outlook.Recipient    
Set outLookApp = CreateObject("outlook.application")         
Set outlookTask = outLookApp.createitem(olTaskItem)    
With outlookTaskoutlookTask.To = Me.Text33      
    .Subject = "Contract Expiry With In Month Of:" & Space(2) &Forms!frmrem!EmpName.Value       
    .body = "EmployeeName:" & Space(2) & Forms!frmrem!EmpName.Value  
    .reminderset = True  
    .duedate = Me.DOJ         
    .ReminderTime = Me.DOJ - 30 & " 8:00 AM"    
    .reminderplaysound = True        
    .Save        
End With    
MsgBox "Successfully task has been set ", vbInformation, "Set task Confirmd"        
End Sub  

1 个答案:

答案 0 :(得分:0)

您可以assign a task接收者可以接受。

可以在TaskItem.Assign Method (Outlook)找到VBA代码。

Sub AssignTask() 

    Dim myItem As TaskItem 
    Dim myTaskAssignee As Recipient 

    Set MyItem = CreateItem(olTaskItem) 
    MyItem.Assign 

    Set myTaskAssignee = MyItem.Recipients.Add("Dan Wilson") 
    myTaskAssignee.Resolve 

    If myTaskAssignee.Resolved Then 
        myItem.Subject = "Prepare Agenda For Meeting" 
        myItem.DueDate = Now + 30 
        myItem.Display 
        myItem.Send 
    End If 

ExitRoutine:
    Set MyItem = Nothing
    Set myTaskAssignee = Nothing

End Sub