View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gina Gina is offline
external usenet poster
 
Posts: 58
Default hyperlinks to word documents

Hi,

I want to open a word document using a hyperlink. Thing is the word
document location may change. Is there a way to refresh the hyperlink when
the word document moves? I've tried doing a search for the document by name
and then opening it once its found but it doesn't seem to work. Here is the
code:

Sub test()
Set fs = Application.FileSearch
With fs
.NewSearch
.FileType = msoFileTypeWordDocuments
.LookIn = "O:\Post 16 Statistics\Key Outputs\CPR Pack\Jul 2006\Databases
& templates\CPR_Interactive"
.Filename = "iCPR faq.doc"
If .Execute 0 Then
With wordApp
.Documents.Open Filename:=.FoundFiles(1)
.Visible = True
End With
Else
MsgBox "There were no files found."
End If
End With
End Sub

Thanks