PDA

View Full Version : Setting AddIn Property of task



mallycat
08-19-2012, 05:52 PM
I am using Outlook 2010 with FranklinCovey Plan Plus (FCPP) for Outlook plug in. FCPP extends the object model for Tasks to include a priority field. When I open "tasks" and go to the views, I can go to field Chooser, go to "user defined fields" and select "A1" which is the display name of the field I want to be able to set in VBA. So I know it is there, but I don't know how to set it using VBA.

I have tried

myTaskItem.UserProperties("A1") = "A1"

ie set the field "A1" to the value "A1". But this did not work. I am not sure if the field name is actually different to the label, or if I am doing something else wrong.

Can anyone help?

JP2112
08-29-2012, 12:51 PM
I tested this code and it worked for me using a sample task item:


Sub setup()
Dim tsk As Outlook.TaskItem
Set tsk = ActiveInspector.CurrentItem
tsk.UserProperties.Add "A1", olText
tsk.UserProperties.Item("A1").Value = "A1"
Debug.Print tsk.UserProperties.Item("A1").Value
End Sub

mallycat
08-29-2012, 02:53 PM
Thanks a lot for your reply and time to try this out. So it seems that the user field structure is there, but the field needs to be first added before it can be set. That makes sense.

Thanks again

Matt

JP2112
08-30-2012, 07:57 AM
You are correct, you have to add the property first, otherwise UserProperties.Item("A1") doesn't point to anything.