Link a task to a contact by setting its ContactItemId property.
The following sample code links a task to a contact:
Public Sub LinkTask(objTask As Object, objContact As Object) objTask.SetProperties ContactItemId:=objContact.ItemId End Sub