View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default Link excel field to Acrobat files

You can highlight the data and 'Insert Hyperlink' to the file. This will
open when you click on it in Adobe Acrobat Reader.

If you have that many and they do not currently have the full path to the
folder but just the file name then this could be automated with some code
similar to below. (Select the data first and be prepared for a wait! Run in
test file first) It takes each cell and sets it as a hyperlink, in my case
to the path of C:\Images and the file name as shown in the selection. It
adds .pdf to the file name although this can be removed.

Sub SetHyperLinks()
Dim myCell As Range
Dim sFName As String
Const sPath = "C:\Images\"
For Each myCell In Selection
' Exclude & ".pdf" if extension in name
sFName = myCell.Value & ".pdf"
myCell.Hyperlinks.Add Anchor:=myCell, _
Address:=sPath & sFName, _
ScreenTip:="Open: " & sFName, _
TextToDisplay:=sFName
Next myCell
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"sympatico" wrote in message
. ..
I have a spreadsheet contains about 22,000 items (pictures information) .
One field (picture name field) of each item (row) has an AcrobatReader
Pictur in an other file. Can I link the values of this field to the PDF
files.

I want the user click on the picture name in the spreadsheet to open the
Acrobat file the have the same name in PDFs file.

Thanks