Prior to installing ArcGIS 10, I had perfectly good VBA scripting in place to use hyperlinks to add raster datasets to ArcMap and place them in a particular group layer. With version 10, I am apparently blocked from using VBA with hyperlinks, other than using the small, crappy script editor on the Hyperlink Script dialog. I am not having any luck inserting and/or adapting my existing VBA scripts for this editor.
The following code is a slight modification of the default VBScript code for the Hyperlink Script dialog. I have inserted the correct field that contains my paths that are needed for hyperlink.
Function OpenLink ( [URL] )
Dim path
Dim objShell
path = [URL]
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute path, "", "", "open", 1
End Function
This code works without error, but it does not do what I need. It opens my raster image in Windows Photo Viewer. What I actually need to do is add the raster image to the map and place it as the top item in a group layer named "FIRM".
Can someone please help me write the correct code?
Thanks.
Greg Allspaw

Reply With Quote


Bookmarks