Dim objFiles: Set objFiles = Vault.ObjectFileOperations.GetFiles(ObjVer)
' During the creation of the object no test is necessary
if ObjVer.Version > 1 then
' Getting files of previous version
Dim ObjVerOld: Set ObjVerOld = ObjVer.Clone()
ObjVerOld.Version = ObjVerOld.Version-1
Dim objFilesOld: Set objFilesOld = Vault.ObjectFileOperations.GetFiles(ObjVerOld)
' If count of files differ then raise exception
if objFiles.Count <> objFilesOld.count then
Err.Raise MFScriptCancel, "Es k?nnen keine Dateien hinzugef?gt oder entfernt werden!"
end if
Dim found
For index = 1 To objFiles.Count
' If a file has a version greater 1 then it was changed => raise exception
if objFiles.Item(index).FileVer.Version <> 1 then
Err.Raise MFScriptCancel, "Es k?nnen keine Dateien ver?ndert werden!"
end if
' If the GUID of the file has changed then the file was replaced => raise exception
found = false
For indexOld = 1 To objFilesOld.Count
if objFiles.Item(index).FileGUID = objFilesOld.Item(indexOld).FileGUID then
found = true
Exit for
end if
Next
if found = false then
Err.Raise MFScriptCancel, "Es k?nnen keine Dateien ausgestauscht werden!"
end if
Next
end if
Is this the recommended solution or is there a simpler way to achive this behaviour?
Thanks for the help.