Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink Default Path

Status
Not open for further replies.

trevorwilliams2

Programmer
Mar 3, 2003
107
0
0
US
Does anybody know if it is possible to change the default path of the insert hyperlink dialog?

My database is outside of the directory of where we are linking to various files. My users often have to drill down through 5 or 6 subfolders to get to the file they need to link.

It would not be a big deal but we are going to have to do this for thousands of documents.

Any help or suggestions would be greatly appreciated!!
 
Hi, I don't know that you can change the dialog box path but if you are dealing with many files in many directories, it might be easier to build the hyperlink strings yourself.

As an example you can obtain the file names and directory paths using FSO and store the text strings in a table. Convert the strings into a proper hyperlink path using a query and then change the text field to hyperlink.

It is fairly easy to do and there are a number of examples in this forum.

Much quicker than individual linking.

Hope that helps.
 
How are ya trevorwilliams2 . . .
trevorwilliams2 said:
[blue] ... is possible to change the default path of the insert hyperlink dialog?[/blue]
Yes its possible and can be done manually, but I doubt you'll attempt it for thousands of docs. So lets move on to the [blue]One-Shot Deal![/blue]

Before we begin [red]be sure to copy the table with the hyperlink (structure & data) under another name. You'll use this table for testing[/red] ... [green]leaving your origional safe.[/green]

I used an [blue]Update[/blue] query with a custom function for speed and simplicity which worked out very well. So here we go ...

In a module in the modules window, copy/paste the following function:
Code:
[blue]Public Function ChangeHypPath(HypDat As String, NewPath As String) As String
   ChangeHypPath = "#" & NewPath & Right(HypDat, Len(HypDat) - InStrRev(HypDat, "\"))
End Function[/blue]

Now the query:
[ol][li]In query design view with the [blue]test table selected[/blue] and the [blue]hyperlink field dragged[/blue] to the first column in the query grid[/li]
[li]Select [blue]Update Query[/blue] from the dropdown list of the [blue]Type Query[/blue] toolbar button.[/li]
[li]On the [blue]Update To[/blue] line enter:
Code:
[blue]ChangeHypPath([HypLnk],"[purple][b]NewPath with ending backslash[/b][/purple]")[/blue]
[purple]Be sure you don't forget the ending backslash![/purple][/li]
[li]Finally on the [blue]Criteria[/blue] line enter
Code:
[blue]Is Not Null[/blue]
[/li][/ol]

When your done the query grid should look like:
Code:
[blue]    Field: YourHyperlinkFieldName
    Table: TestTableName
Update To: ChangeHypPath([HypLnk],"[purple][b]D:\Database\Images\Cars\[/b][/purple]") [green]'Example![/green]
 Criteria: Is Not Null[/blue]
Thats it ... run the query!

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top