SetDocumentPropEx

Set properties of a document

Public Function SetDocumentPropEx(ByVal DocId As Long,ByRef DocProp() As Byte, ByVal DuplicateFlag As String, Optional ByVal FolderId As Long = 0) As Long

 

Parameters

In/out

Name

Data type

Description

In

 

DocId

Long

Index of the document whose property is to be set

In,Out

 

DocProp

 Byte[TagDocument]

[In]Properties to be set

[Out]Properties of folder after being set

In

DuplicateFlag

String

Tells whether document name can be duplicated - 'Y'/'N'

In

FolderId

Long

Index of folder which contains the corresponding document.

 

Description

This function is used to set the properties of the document. The parameter 'DuplicateFlag' is used at the  backend to decide whether a duplicate document name is allowed or not, if Passed as “Y” document names are created as, for example Mydoc->Mydoc(1) and Mydoc(1)->Mydoc(2).

'FolderId' is to be passed only in cases when 'DocStatus' of the document is to be changed.

 

Return value

Name

Description

 1

In case of success

-1

Invalid cabinet name

-2

Local cabinet is read-only

-3

Cabinet not connected

-31

Document with the same name already exist

-201

Insufficient rights for the current operation

-133

User not logged in

 

Example

    Dim lRetval                  As Long

    Dim bDocProp()            As Byte

    Dim udtDocProp            As TagDocument

    Dim lDocId                   As Long

    Dim sDuplicateFlag       As String

    Dim gPDb                    As PanDb.pdbCls
    

    Set gPDb = New PanDb.pdbCls

    lDocId = 9

    sDuplicateFlag = ”Y”

    udtDocProp.DocName = "MyDoc"

    udtDocProp.Doctype = “TIF”

    udtDocProp.Author = “Mukesh”

    udtDocProp.sLinked = “Y”

    udtDocProp.ExpiryDateTime =  '"12/03/2003"

 

    ReDim bDocProp(Len(udtDocProp) - 1)

    Call CopyMemory(bDocProp(0), udtDocProp, Len(udtDocProp))

 

    lRetval = gPDb.SetDocumentProp(lDocId, bDocProp,sDuplicateFlag)

    If lRetval <> 1 Then

        MsgBox gPDb.ErrDescription

    Else

        MsgBox "Success"

    End If