Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

UserProperty.Formula Property (Outlook)

Published: July 16, 2012

Returns or sets a String representing the formula for the user property. Read/write.

expression .Formula

expression A variable that represents a UserProperty object.

The following Visual Basic for Applications (VBA) example shows how to use the Formula property.

Sub TestFormula() 
 
 Dim tki As Outlook.TaskItem 
 
 Dim uprs As Outlook.UserProperties 
 
 Dim upr As Outlook.UserProperty 
 
 
 
 Set tki = Application.CreateItem(olTaskItem) 
 
 tki.Subject = "Work hours - Test Formula" 
 
 ' TotalWork and ActualWork are in units of minutes 
 
 tki.TotalWork = 4 * 60 
 
 tki.ActualWork = 3 * 60 
 
 Set uprs = tki.UserProperties 
 
 Set upr = uprs.Add("Total&ActualWork", olFormula) 
 
 upr.Formula = "[Total Work] + [Actual Work]" 
 
 tki.Save 
 
 tki.Display 
 
 MsgBox "The Work Hours are: " & upr.Value / 60 
 
End Sub
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.