The code below is passed a valid contact object instance, field name (i.e., Last Name) and value. But it produces an Index out of range error. Can anyone tell me what I am doing wrong?


private void SetContactFieldGroupWise(GroupwareTypeLibrary.Addr essBookEntry5 cont, string
GroupWiseField, string value)
{
GroupwareTypeLibrary.Field fld;

try
{
fld = cont.Fields.Item(GroupWiseField, GroupwareTypeLibrary.FieldTypeConstants.egwString) ;
fld.Value = value;
}
catch (System.Exception ex)
{
bc.OKMessage(ex.Message);
}
}