CorpoKillsMe
New Member
- Joined
- Nov 26, 2017
- Messages
- 1
Hi Everybody,
I'm looking for a way to create a VBA code to hyperlink to a particular folder on worksite.
So far, I have only come up with a macro that links files on the basis of their database numbers
but folders do not have database numbers. They have something called FolderID.
I got some help and al I know is that you can create a similar link:
iwl:dms=[ServerName]&&lib=[DatabaseName]&&page=[FolderID]
Another thing is that I wanted the folders to be opened on Outlook (Worksite is connected with Outlook in my company and we access folders through it)
To sum up, what I try to accomplish is creating hyperlinks in Excel for easy folder access (just like hyperlinks to files).
I've posted the code I'm trying to build up something with below. I'm struggling with the syntax of the ImanFolder and I know it's wrong because I don't know how to move around in iManage. I got the reference to Imanage Library.
Thanks in advance for any help on this one.
I'm looking for a way to create a VBA code to hyperlink to a particular folder on worksite.
So far, I have only come up with a macro that links files on the basis of their database numbers
Code:
[COLOR=#242729][FONT=Consolas]With Selection
.Hyperlinks.Add Anchor:=Selection, Address:="iwl:dms={serverName}&&lib={databaseName}&&num={dat**abaseNumber - 7digits}&&ver=1&&latest=1", TextToDisplay:="link"
End With[/FONT][/COLOR]
but folders do not have database numbers. They have something called FolderID.
I got some help and al I know is that you can create a similar link:
iwl:dms=[ServerName]&&lib=[DatabaseName]&&page=[FolderID]
Another thing is that I wanted the folders to be opened on Outlook (Worksite is connected with Outlook in my company and we access folders through it)
To sum up, what I try to accomplish is creating hyperlinks in Excel for easy folder access (just like hyperlinks to files).
I've posted the code I'm trying to build up something with below. I'm struggling with the syntax of the ImanFolder and I know it's wrong because I don't know how to move around in iManage. I got the reference to Imanage Library.
Thanks in advance for any help on this one.
Code:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">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</code>