Uploading file to iManage/Worksite to a particular folder

1.6k Views Asked by At

I have a particular FolderID and I'd like to upload files to this directory. (I have the reference to the iManage.dll and ImanEXTLib).

I'm struggling with filling out certain fields in the dialog/import window from the code level.

Ideally, I would like to skip this stage to make the upload faster. If I'm conveying all the required data then I can't see any point in the dialog besides clicking OK.

This is the code:

I'm locating the folder by using ManDMS.CreateSearchParameters

After getting results:

Dim rslts as IManFolders
Set rslts = IManSession.WorkArea.SearchFolders(<ManStrings>,<SearchParameters>)
If rslts.Empty = True Then
    MsgBox "Found shit."
Elseif rslts.Empty = False Then
    Dim TgtFdr as ImanFolder
    Set impCmd = ImportCmd
    Set context = New ContextItems
    Set TgtFdr = rslts.ItemByIndex(1)

Now I'm setting the context items but I have the problem with Matter and Subclass. These are obligatory for the upload but the fields remain empty and I don't know how to address them to complete the upload:

context.Add("IManDestinationObject", TgtFdr)
context.Add("IManExt.Import.DocAuthor", UserID)
context.Add("IManExt.Import.DocDescription", file Name)           
context.Add("IManExt.Import.FileName", file path)
context.Add("IManExt.Import.DocClass", "some info")
context.Add("IManExt.Import.DocSubclass", "some info")
context.Add("IManExt.Import.DocMatter", "some info")

impCmd.Initialize context
impCmd.Update

If impCmd.Status = IMANEXTLib.CommandStatus.nrActiveCommand Then

    impCmd.Execute
Else
Endif

Tried different things - MatterID, MatterDesc, Custom1,2,3,. Is it possible to skip the part with this window and upload the file in a more straightforwrd way? Also, is it possible to to take out the doc number of the newly imported file at the end?

I tried:

UplDoc = (ImanDocument)context.Item("ImportedDocument")
1

There are 1 best solutions below

0
On

I figured the whole thing out.

Sort of... I went into the object browser and managed to go around the problem and take advantage of the .DuplicateProfileFromDoc method. I simply mirror the profile of the uploaded doc from other already stored on worksite.

The last bit also solved. It should be:

Set UplDoc = context.Item("ImportedDocument")

Cheers!