Saving to iManage with VBA

1k Views Asked by At

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.

0

There are 0 best solutions below