Hi,
I'm trying to create a public shared link in a vbs. I saw that we need to be in server mode to use the method CreateSharedLink. Is it possible to use it in the context of a vbs ?
If docObjectFile.Count > 0 Then Dim dt dt = DateAdd("d", 3, Now) Dim expiration : Set expiration = CreateObject("MFilesAPI.Timestamp") expiration.Day = Day(dt) expiration.Year = Year(dt) expiration.Month = Month(dt) expiration.Hour = Hour(dt) expiration.Minute = Minute(dt) expiration.Second = Second(dt) Dim sharedLinkInfo : Set sharedLinkInfo = CreateObject("MFilesAPI.SharedLinkInfo") sharedLinkInfo.Description = "Document mis en ligne" sharedLinkInfo.ExpirationTime = expiration sharedLinkInfo.LinkType = MFSharedLinkType.MFSharedLinkTypeReadOnly sharedLinkInfo.ObjVer = docObjVer sharedLinkInfo.FileVer = docObjectFile(1).FileVer sharedLinkInfo.FileVer.Version = -1 Dim sharedLink : Set sharedLink = Vault.SharedLinkOperations.CreateSharedLink(sharedLinkInfo) err.Raise MFScriptCancel, sharedLink End If
For now, I did this code. But MFiles give me the error Not found when I execute the script. The error happens on the line : Dim sharedLink : Set sharedLink = Vault.SharedLinkOperations.CreateSharedLink(sharedLinkInfo)
Thanks for your help and have a nice day.