ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hyperlinks to word documents (https://www.excelbanter.com/excel-programming/368537-hyperlinks-word-documents.html)

Gina

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


All times are GMT +1. The time now is 05:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com