Share via


Specifying the Common Script File

Specifying the Common Script 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 common script file is a text document containing script functions that you can share among many workflow applications. To specify the common script file, you can:

The following code demonstrates how to load the common script as the default Stream property of the ProcessDefinition item.

Note   You must set the Charset property of the Stream to Unicode.

Visual Basic

   Dim fso As New Scripting.FileSystemObject
   Dim file1 As TextStream

   Set file1 = fso.OpenTextFile(cstPath)

   Dim commonscripttext As String
   commonscripttext = file1.ReadAll

   Dim Rec As New ADODB.Record
   Dim Conn As New ADODB.Connection
   Dim Stm As New ADODB.Stream

   With Conn
      .Provider = "Exoledb.datasource"
      .ConnectionString = wfFolder
      .Open
   End With

   Rec.Open pdURL, Conn, adModeReadWrite, adCreateOverwrite

   With Stm
      .Open Rec, adModeReadWrite, adOpenStreamFromRecord
      .Charset = "unicode"
      .Type = adTypeText
      .Position = 0
      .SetEOS
      .WriteText commonscripttext
      .Position = 0
      .Flush
      .Close
   End With

   ' Clean up.
   Conn.Close
   Rec.Close
   Stm.Close

   Set Conn = Nothing
   Set Rec = Nothing
   Set Stm = Nothing

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.