Hello.
I have manually added a field called 'TestField' to Outlook2003 Tasks. I would like to be able to create a task from MS Access using VB and set the value of some fields including the user defined field. The code I am using sucessfully creates the task and sets a built in field, if I remove the line setting the UDF.
Could anyone please point out where I am going wrong and tell me how to set the UDF please.
The code I am using is:
Sub CreateTask()
Dim olApp As Outlook.Application
Dim olTsk As TaskItem
Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)
With olTsk
.Subject = "Test task creation"
.olTsk.UserProperties("TestField") = "not working"
.Save
End With
Set olTsk = Nothing
Set olApp = Nothing
End Sub
Thank you in advance for any help.
I have manually added a field called 'TestField' to Outlook2003 Tasks. I would like to be able to create a task from MS Access using VB and set the value of some fields including the user defined field. The code I am using sucessfully creates the task and sets a built in field, if I remove the line setting the UDF.
Could anyone please point out where I am going wrong and tell me how to set the UDF please.
The code I am using is:
Sub CreateTask()
Dim olApp As Outlook.Application
Dim olTsk As TaskItem
Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)
With olTsk
.Subject = "Test task creation"
.olTsk.UserProperties("TestField") = "not working"
.Save
End With
Set olTsk = Nothing
Set olApp = Nothing
End Sub
Thank you in advance for any help.