|
Y'all--
I am using Access 2002 and creating an application that converts large sections of a user's file directory structure into tables of hyperlinks for querying and analysis. To do this, I have invoked the FileSystemObject and used GetFile and GetFolder in a recursive function that 'crawls' over the directory - grabbing 'Path' and 'Name' attributes and concatenating them with a hyperlink '#' separator. If a user clicks on the link in a form, backed by the resulting table, it follows effectively to the target file/resource, regardless of type.
But(!) if the links are then followed from code using the object.hyperlink.follow method, everything works as expected when a link is a regular file or a URL...but when a file shortcut has been copied into a table's hyperlink field it totally fails...and in a very strange fashion! Sometimes it does nothing, sometimes it pulls the directory where the shortcut is stored, rather than the 'target' file of the shortcut. When I query the text property of the control bound to the hyperlink field it shows a zero-length string! This is a very unhappy function, clearly.
Sadly, the solution of just storing the target of the alias to begin with, replacing the shortcut with a hyperlink address style that is known to work, seems quite hard to do. I am unable to find a way of getting at that information from the FileSystemObject or from an equivalent API. Also, I have tried 'simulating' the click event, in order to 'steal' its effective translation of the '.lnk' into the target file...but that has proven completely opaque as well...
This is VERY frustrating...the documentation of these matters is not particularly available or detailed...Any ideas are welcome - Thank you!
--Matthue |