You can try this subroutine. Just change "C:\Test" to the actual target
folder where you want to hyperlink to files. I have it set up to use the
file name as the text show which is what I think you wanted from your
question and I set it up so each link is a new paragraph.
_________________________________
Sub HyperToFldrFiles()
Dim strTgtFldr As String
Dim strShow As String
' Designate the folder where files are found
strTgtFldr = "C:\Test"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldTarget = fso.GetFolder(strTgtFldr)
Selection.TypeParagraph
For Each myFile In fldTarget.Files
strShow = fso.GetFileName(myFile)
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, _
Address:=myFile, TextToDisplay:=strShow
Selection.TypeParagraph
Next myFile
End Sub
__________________________________
Steve Yandl
>I would like to know if it is possible to have a document read a folders
> contents and create hyperlinks to the files in that folder based on the
[quoted text clipped - 3 lines]
> Thanks,
> Steve
Steve L - 19 Nov 2007 14:01 GMT
Thanks! That worked great.
Steve
> You can try this subroutine. Just change "C:\Test" to the actual target
> folder where you want to hyperlink to files. I have it set up to use the
[quoted text clipped - 35 lines]
> > Thanks,
> > Steve