Share via


GetNewWorkflowMessage Method

GetNewWorkflowMessage Method

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.

Returns a new WorkflowMessage object.

Applies To

IWorkflowSession Interface

Type Library

Microsoft CDO Workflow Objects for Microsoft Exchange

DLL Implemented In

CDOWF.DLL

Syntax

[Visual Basic]Function GetNewWorkflowMessage
() As WorkflowMessage

[C++]HRESULT GetNewWorkflowMessage (     IWorkflowMessage** ppWorkflowMessage );

Parameters

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

This method enables script access to the WorkflowMessage object. The WorkflowMessage object provides message sending and tracking ability per ProcessInstance through its SendWorkflowMessage method.

Example

This example illustrates the use of the GetNewWorkflowMessage method. This is a member method of the WorkflowSession intrinsic object. You do not have to create the WorkflowSession object because the workflow engine passes it to the script host. GetNewWorkflowMessage returns a WorkflowMessage object. As a result, the script can use the IWorkflowMessage interface to set the From, To, Subject, and TextBody fields, as well as send the message.

Sub SendMail(MySubject) Set WFMsg = WorkflowSession.GetNewWorkflowMessage() With WFMsg .From = WorkflowSession.Sender .To = WorkflowSession.Sender .Subject = MySubject .TextBody = WorkflowSession.StateFrom & " -> " & WorkflowSession.StateTo .SendWorkflowMessage 0 'cdowfNoTracking End With End Sub

See Also

IWorkflowMessage Interface

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.