Hello all,
I'm new to the forums. Learning VBA to automate some tasks and work and have some problems i can't solve, so hope you guys can help me.
I need to create a task from shared company inbox. When I run below code it creates task, but only on my username. Even if I define owner, when trying to save it just reverts to me. I have only basic knowledge of VBA, so if someone can help me adjust the code it would be a great help.
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 "shared@inbox.com" 'workaround to assign task for another owner, but does not show .BCC so not suitable solution.
.Owner = "shared@inbox.com" ' 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
Bookmarks