View Single Post
 
Old 06-13-2018, 11:01 AM
d4okeefe d4okeefe is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Apr 2013
Posts: 77
d4okeefe is on a distinguished road
Default

I looked around, and I don't think there's a way change the default directory in the Edit Hyperlink dialog, which is frustrating.

One thing I've done in the past is add generic hyperlinks, then edit the fields manually. For example, if the text in your document to which your adding links contains a consistent phrase, like ".pdf", you could add generic links with the following.

Code:
Sub add_generic_links()
    Dim r As Range, r1 As Range
    Set r = ActiveDocument.Content
    With r.Find
        .ClearFormatting
        .Text = ".pdf"
        Do While .Execute
            Set r1 = r.Duplicate
            r1.MoveStart wdCharacter, -1
            r1.Expand wdWord
            ActiveDocument.Hyperlinks.Add r1, "c:\scratch"
        Loop
    End With
End Sub
Type Alt-F9 to view the hyperlinks, and you'll see something like this:
{ HYPERLINK "c:\\scratch" }
You can edit the directory from there.

Sorry there isn't an easier way.
Reply With Quote