LukaszPe
LukaszPe

Reputation: 67

Hyperlinking a folder stored on iManage

I'm looking for a way to create a hyperlink to a particular folder in Worksite. So far, I've only come up with a macro linking files on the basis of their database numbers but folders do not have database numbers (I think). Another thing is that I wanted the folders to be opened in Outlook (Worksite is connected with Outlook and we access folders through it) What I try to accomplish is creating hyperlinks in Excel for easy folder access (just like hyperlinks to files). Does anybody have a clue if it's even possible? If yes, I'd appreciate an example of a code for this. Thanks in advance.

Upvotes: 1

Views: 2941

Answers (2)

LukaszPe
LukaszPe

Reputation: 67

Sub Folder_link

Dim dmsIM As IManDMS
Dim dmsS As IManSession
Dim dmsD As IManDatabase
Dim FdR As IManFolder
Dim FdrLoc As String
Dim FdrID As Long

Const ServerName As String = <DMS name>
Const DatabaseName As String = <DatabaseName>
FdrLoc = "\\{DMS name}\{DatabaseName}\Main Folder\SubFolder\SubSubFolder\TargetFolderName"

Set dmsIM = New ManDMS
Set dmsS = dmsIM.Sessions.Add(ServerName)
dmsS.TrustedLogin

Set dmsD = dmsS.Databases.ItemByName(DatabaseName)

Set Fdr = Imanage.ImanFolder.Location (FdrLoc)

FdrID = Fdr.FolderID

With ThisWorkBook.WorkSheets(1).Range("A1")
    .Hyperlinks.Add _
    Anchor:=Selection, _
    Address:="iwl:dms={serverName}&&lib={databaseName}&&page=" & FdrID, _
    TextToDisplay:="link" 
End With

End Sub

Upvotes: 1

fivetoniner
fivetoniner

Reputation: 131

Yes it's possible.

You don't mention which version of the iManage client you're working with however I'm going to assume FileSite 9.x. Installed with that client is a custom protocol handler which supports a custom URI scheme.

In effect this allows you to compose a hyperlink with plain text which you can then embed in your web page, or just start a new process in Windows to let the default browser load it up.

The custom protocol handler will parse it and then start up whatever iManage client it can (FileSite in your case) and then navigate to the correct folder.

Format is iwl:dms=[ServerName]&&lib=[DatabaseName]&&page=[FolderID]

Here's some C# that builds out such a string

var serverName = "MYSERVERNAME";
var databaseName = "MYDBNAME"; 
var serverName = "1234"; // internal numeric ID of folder (MHGROUP.PROJECTS.PRJ_ID in database, or IManFolder.FolderID via iManage COM API object model

var sb = new StringBuilder("iwl:");

sb.Append($"dms={serverName}");
sb.Append("&&");

sb.Append($"lib={databaseName}");
sb.Append("&&");

sb.Append($"page={serverName}");

// sb.ToString() will now output the hyperlink reference to your folder which you can pass to your web browser..

Upvotes: 2

Related Questions