SaveDocument

Saves a document on the application server.

Tip:

SaveDocumentEx also saves a document, and provides additional options to specify the document’s content type and privacy flag.

Syntax

<HsvReports>.SaveDocument bstrPath, bstrName, bstrDescription, lDocumentType, lDocumentFileType, lSecurityClass, varabyDocument, vbOverwriteExisting

Argument

Description

bstrPath

String (ByVal). The path of the folder containing the documents. The folders in the path are delimited by backslashes ( \ ).

bstrName

String (ByVal). The name of the document.

bstrDescription

String (ByVal). The description of the document.

lDocumentType

Long (ByVal). The document type. Valid values are represented by the HFMConstants type library constants listed in Document Type Constants.

lDocumentFileType

Long (ByVal). The file type of the document. Valid values are represented by the HFMConstants type library constants listed in Document File Type Constants.

lSecurityClass

Long (ByVal). The ID of the document’s security class.

Tip:

You can get the ID from a security class name with GetSecurityClassID.

varabyDocument

Byte array (ByVal). The document’s definition as an array of Bytes.

vbOverwriteExisting

Boolean (ByVal). Determines whether to overwrite a document of the same name on the application server. Pass TRUE to overwrite existing documents, FALSE otherwise.

Example

The following subroutine saves the specified journal report in the .RPT format. Note that the subroutine uses HsvSecurityAccess.GetSecurityClassID to get the ID of the security class that is passed.

Sub saveJournalRpt(sPath As String, sName As String, _
   sDesc As String, sSecClass As String, baDoc() As Byte)
Dim cSecurityAccess As HsvSecurityAccess, lSecID As Long
'm_cSession is an HsvSecurityAccess object reference
Set cSecurityAccess = m_cSession.Security
'm_cReports is an HsvReports object reference
cSecurityAccess.GetSecurityClassID sSecClass, lSecID
m_cReports.SaveDocument sPath, sName, sDesc, _
   WEBOM_DOCTYPE_RPTJOURNAL, WEBOM_DOCFILETYPE_RPTDEF, lSecID, _
   baDoc, True
End Sub