G
Guest
I am trying to create user-defined-fields in my contacts folder that have formulas programmatically. I'm having no issues with creating the fields themselves, but for some reason the formulas that I set are not there in Outlook. Here is a code snippet - can anyone help
Dim myolapp as new Outlook Applicatio
Dim StandardContact as Outlook.ContactIte
Dim ContactProperties as Outlook.UserPropertie
Dim FormulaField as Outlook.UserPropert
Set StandardContact = myOlApp.CreateItem(olContactItem
Set ContactProperties = StandardContact.UserPropertie
Set FormulaField = ContactProperties.Add("Formula Field", Outlook.OlUserPropertyType.olFormula
FormulaField.Formula = "DateDiff('d',Now(),[Test Date])
MsgBox "Formula Field value = " & FormulaField.valu
"Test Date" is another userproperty that is set up elsewhere in the code. The message box shows the correct value, but when the formula field shows up in the Field Chooser of the Contacts folder in the user-defined fields in folder section the formula is blank. Does anyone know what I am doing wrong
Thanks
rdw
Dim myolapp as new Outlook Applicatio
Dim StandardContact as Outlook.ContactIte
Dim ContactProperties as Outlook.UserPropertie
Dim FormulaField as Outlook.UserPropert
Set StandardContact = myOlApp.CreateItem(olContactItem
Set ContactProperties = StandardContact.UserPropertie
Set FormulaField = ContactProperties.Add("Formula Field", Outlook.OlUserPropertyType.olFormula
FormulaField.Formula = "DateDiff('d',Now(),[Test Date])
MsgBox "Formula Field value = " & FormulaField.valu
"Test Date" is another userproperty that is set up elsewhere in the code. The message box shows the correct value, but when the formula field shows up in the Field Chooser of the Contacts folder in the user-defined fields in folder section the formula is blank. Does anyone know what I am doing wrong
Thanks
rdw