我需要從共享收件箱創建Outlook任務。到目前爲止,當下面的代碼運行,任務創建與共享收件箱的所有者,因爲我想,但保存時,我得到「您必須在公共文件夾中更改任務的所有者字段」錯誤,所有者將更改回給我。從共享收件箱創建Outlook任務
我找不到解決方案,或者它可能超出了我的理解範圍。我很感激幫助。謝謝!
If task = "YES" Then
user_task = "GR"
Const olTaskItem = 3
Dim OlApp As Object
Dim OlTask As Object
Set OlApp = CreateObject("Outlook.Application")
Set OlTask = OlApp.CreateItem(olTaskItem)
With OlTask
'.Assign
'.Recipients.Add "[email protected]" 'workaround to assign task for another owner, but does not show .BCC so not suitable solution.
.Owner = "[email protected]" ' does not work. changes back to my user
.Subject = material_full_email & " spp "
.StartDate = Date
.DueDate = Date + 7
.Status = 1 '0=not started, 1=in progress, 2=complete, 3=waiting,
'4=deferred
.Importance = 1 '0=low, 1=normal, 2=high
.ReminderSet = False
'.ReminderTime = dtReminderDate
'.Categories = "Business" 'use any of the predefined Categorys or create your own
.Body = Date & " " & user_task & ":" & " RFQ sent: " & Supplier1 & "/" & Supplier2 & "/" & Supplier3 & "/" & Supplier4
'.Save 'use .Display if you wish the user to see the task form and make
.Display 'them perform the save
End With
End If
嗨德米特里。我在vba方面經驗不足。你認爲你可以給你的建議一段代碼適配器嗎?當我試圖做到這一點,我只是不能讓它工作。感謝您的回答 – Trm 2015-03-13 19:01:05
查看最新的答案。 – 2015-03-13 19:29:19
嗨。我今天早上嘗試運行代碼,但無法使其工作。它運行,但不會產生任何任務。你有什麼想法可能是錯誤的? – Trm 2015-03-16 07:44:20