AnsweredAssumed Answered

GetLatest with Code

Question asked by Steve Anderson on Apr 18, 2019
Latest reply on Apr 18, 2019 by Artem Taturevych

Hello:

 

I am looking to simple Get the latest version on a single vile in code.  I am not sure what to set EdmSelItem to, which I believe may be the problem.

 

    Private Sub GetLatest2(fPath As String)
        Dim eFile As IEdmFile7 = VAULT.GetFileFromPath(fPath)
        Dim EPos As IEdmPos5 = eFile.GetFirstFolderPosition()
        Dim eFolder As IEdmFolder6 = eFile.GetNextFolder(EPos)
        Dim files(1) As EdmSelItem

        files(0).mlDocID = eFile.ID ' Get File ID
        files(0).mlProjID = eFolder.ID ' Get Folder ID file is in

        Dim bg As IEdmBatchGet = VAULT.CreateUtility(EdmUtility.EdmUtil_BatchGet)

        bg.AddSelection(VAULT, files)
        bg.CreateTree(0, EdmGetCmdFlags.Egcf_Nothing)
        bg.GetFiles(0, Nothing)

    End Sub

 

 

On      bg.AddSelection(VAULT, Files)

: 'The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))'

 

Thank You!

Outcomes