Share via


Creating and Posting a Message

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 describes a PostMsg procedure, which creates and posts a message in your workflow-enabled folder in response to workflow events.

Example Script

'// -----------------------------------------------------------------------------------
'// Name      : PostMsg
'// Purpose   : Posts a message in the designated folder for the user who initiated the action.
'// Prereq    : none
'// Inputs    : strSubject, subject for the post. StrDomain, domain where folder is located, strFolder location of the folder where item will be posted
'// Return    : Item posted in designated folder.
'// -----------------------------------------------------------------------------------
Sub PostMsg(strSubject, strDomain, strFolder)
  MyURL = "file://./backofficestorage/" & strDomain & "/Public Folders/" & strFolder
  Set MyMsg = CreateObject("CDO.Message") 
  MyMsg.Subject = strSubject 
  MyMsg.TextBody = "This is a Text Body" 
  MyMsg.From = WorkflowSession.Sender 
  MyMsg.DataSource.SaveTo MyURL & "/" & strSubject, Nothing
End Sub

See Also

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