Skip to content

Latest commit

 

History

History
73 lines (39 loc) · 1.3 KB

Outlook.UserProperty.Formula.md

File metadata and controls

73 lines (39 loc) · 1.3 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
UserProperty.Formula property (Outlook)
vbaol11.chm217
vbaol11.chm217
Outlook.UserProperty.Formula
91d2a104-8a93-a1e3-f31a-a0351153496d
06/08/2017
medium

UserProperty.Formula property (Outlook)

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

Syntax

expression.Formula

expression A variable that represents a UserProperty object.

Example

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

See also

UserProperty Object

[!includeSupport and feedback]