MS Outlook VBA- editing an empty value of a task item

Joined
Aug 24, 2017
Messages
1
Reaction score
0
Hello,

I wrote a simple code to add an Index number to every task in the task folder. I created a custom field called "index". The code loops through all of the tasks and just puts the number of the task (not sure what the order is) in the "index" field of each task. For some reason, it only works if there is some value assigned to the "index" field. If it's empty, it does nothing.

For i = 1 To objFolder.Items.Count
Set xitem = objFolder.Items(i)
xitem.UserProperties.Find("index") = i
xitem.Save
Next i
Any help would be appreciated.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top