0

I am trying to find sample VBA for saving an Excel file to iManage. I have some code which lets me download a document but I don't know if there is anything similar for saving to a workspace.

The Excel file would have a workspace refernce e.g. 123456/0001 and so the macro code would look at this and then save to the Workspace with that client/matter number.

The code I have for interacting with iManage is here:

Private Sub DownloadDoc()

Dim dmsRoot As IManDMS
Dim dmsSession As IManSession
Dim dmsDatabase As IManDatabase
Dim doc As IManDocument

Dim tempDocName As String

Const ServerName As String = "MYSERVER"
Const DatabaseName As String = "MYDATABASE"

Const DocNumToFind = 7487741
Const DocVerToFind = 1

tempDocName = "C:\temp\mydoc.docx"

    Set dmsRoot = New ManDMS
    Set dmsSession = dmsRoot.Sessions.Add(ServerName)
    dmsSession.TrustedLogin

    Set dmsDatabase = dmsSession.Databases.ItemByName(DatabaseName)
    Set doc = dmsDatabase.GetDocument(DocNumToFind, DocVerToFind)

   doc.GetCopy tempDocName, imGetCopyOptions.imNativeFormat
   End Sub

I am conscious that I don't really have much code at all and so even just a couple of pointers/methods etc. that I can go and research some more would be appreciated.

2
  • Adding a file to a (document folder in a) workspace usually involves first getting hold of the right workspace (which translates to an IManWorkspace instance in the COM API), either by searching for it using metadata or just getting a pointer to that workspace object instance of you happen to have the workspace unique ID. From there you normally locate the appropriate folder in that workspace. You then upload the document and you usually then manually copy the folder metadata to the document profile itself. Quite a few steps! Or do you just want to make an existing doc appear in a folder? Oct 30, 2018 at 8:45
  • Hi thanks for the reply - you are right it is quite an involved process so I have hired a company to write the macro for me. They said they could either write a .NET component that I can reference from the VBA or do it in pure VBA using COM extensibility. I've gone for pure VBA so I can understand how it all works.
    – Ed Mozley
    Nov 9, 2018 at 15:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.