Hi, i'm pretty unexperienced with vbscript, but i've been working on a script to add documents to a certain workspace in interwoven.
I started out from some of the C# code i found on this forum, but i can't get the Add method. I have this:
Set wps = dms.CreateFolderSearchParameters
wps.Add imFolderAttributeID.imFolderName, FolderName
wps.Add imFolderAttributeID.imFolderOwner, "kvanlondersele"
when the script reaches the Add function, i get this error:
Microsoft VBScript runtime error: Object required: 'imFolderAttributeID'
I also tried with Add(), but then it says i can't use parenthesis in a sub.
Anyone familiar with this?
below is my code up until now, maybe there's something else that's causing the error:
Call MoveToDMS()
public function MoveToDMS()
Dim ServerName, DatabaseName, FolderName, SourceFile
ServerName = "SERVERSERVER"
DatabaseName = "DMS-PROD"
FolderName = "Personal Workspace"
SourceFile = "C:\test\myfile.txt"
Dim dms, sess, db, wps, dblist, results, fldr
Set dms = CreateObject("Imanage.ManDMS")
Set sess = dms.Sessions.Add(ServerName)
sess.Login "JOHNSON", "johnson" 'admin
Set db = sess.Databases.ItemByName(DatabaseName)
Set wps = dms.CreateFolderSearchParameters
wps.Add imFolderAttributeID.imFolderName, FolderName
wps.Add imFolderAttributeID.imFolderOwner, "kvanlondersele"
Set dblist = CreateObject("Imanage.ManStrings")
dblist.Add db.Name
Set results = sess.WorkArea.SearchFolders(dblist, wps)
if results.Empty = true then
MsgBox "No results returned based on the search criteria."
sess.Logout
End if
Set fldr = null
if results.Empty = false then
'Assuming there is only one workspace returned from the results.
Set fldr = CreateObject("IManDocumentFolder")
results.ItemByIndex(1)
end if
if fldr is not null then
ContextItems context = new ContextItemsClass
ImportCmd impCmd = new ImportCmdClass
context.Add IManDestinationObject, fldr
context.Add IManExt.Import.FileName, SourceFile
context.Add IManExt.Import.DocAuthor, sess.UserID
context.Add IManExt.Import.DocClass, "DOC"
impCmd.Initialize(context)
impCmd.Update()
if impCmd.Status = cint(CommandStatus.nrActiveCommand) then
impCmd.Execute()
Set brefresh = cbool(context.Item("IManExt.Refresh"))
if brefresh = true then
'Succeeded in importing a document to WorkSite
Set doc = IManDocument(context.Item("ImportedDocument"))
'Succeeded in filing the new folder under the folder.
MessageBox.Show("New document number, " + doc.Number + ", is successfully filed to " + fldr.Name + " folder.")
end if
end if
me.Close()
end if
End function