User Defined Fields adding new value (2)


New Member
Outlook version
Outlook 2016 64 bit
Email Account

I came across this little discussion (User Defined Fields adding new value) and I want to do some similar thing.

In my taskliste in outlook, I added a custom field with the name "priority". In want to set 4 different values in there. (e.g. "1_doing", "2_waiting", "3_thisWeek", "4_todo")
I was thinking to program 4 macros.

I found something like this but I struggle to set the value in my user defined field.

Sub setPriority()

  Dim Exp As Outlook.Explorer
  Dim Sel As Outlook.Selection
  Dim Task As Outlook.TaskItem

  Set Exp = Application.ActiveExplorer
  Set Sel = Exp.Selection
  If Sel.Count Then
   For Each Task In Sel

--> add code here to set the value in the custom field on selected TaskItems to "1_doing"

  End If
End Sub
any help is very much appreciated.