Share via


Expire Item and Send Notification

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The following example sends e-mail to the item owner indicating that an item that has been awaiting attention/action has now expired. The item is returned to the Draft state. This example was designed for an expense report approval process.

Sub ExpireExpenseReport()

   Dim strSubject
   Dim strBody

   strSubject = "Action Required: Expense Report Approval Request"

   strOutlookURL = GetPathAndSubject
   strBody = "There is an expense report waiting for your approval." _
      & vbCRLF & vbCRLF
   strBody = "View the expense report by clicking here. _
      <outlook://public folders/All public Folders/" _
      & strOutlookURL & ">" & vbCRLF & vbCRLF
   strBody = "----------------------------------------" & vbCRLF
   strBody = "Submitted: " & CTXT(Date) & "  " & CTXT(Time) & vbCRLF
   strBody = "Expense ending state: " & WorkflowSession.StateTo

   strSMTPAddress = WorkflowSession.Fields("ApprovalAuthority").Value

   SendMessage strSMTPAddress, strSubject, strBody

End Sub

See Also

Scripting in the Workflow Designer for Exchange Server | Script Examples for Exchange Server | Creating Script Procedures