Share via


Writing Messages to File

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 WriteFile procedure, which creates a text file and adds text to the file in response to workflow events.

Example Script

'// -----------------------------------------------------------------------------------
'// Name      : WriteFile 
'// Purpose   : Creates a file and appends a line of text to the file.
'// Prereq    : none
'// Inputs    : strFileName, filename and extension;strFileText, any text string you wish to dislay in the message body.
'// Return    : Creates a file, appends text to the file.
'// -----------------------------------------------------------------------------------
Sub WriteFile (strFilename,strFileText) 
   Set fso = CreateObject("Scripting.FileSystemObject") 
   Set f = fso.CreateTextFile(strFilename)
   f.writeline(strFileText)
   f.close
   set fso = Nothing
end sub

See Also

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