On 2002-04-25 21:49, a_sanchez wrote:
Thanks for your answer.
The PDF files came on technical data cd which doesn't work anymore, so I put them in a folder in HD. I created an index so I can search for reference and excel points to filename to open. At this point I switch to Reader and open file.
I'd like to point to reference in Excel and open the Reader's file.
When you say index / points to filename
I'm assuming you mean you have the Full file
name listing in the rows ??
eg.
<HTML><HEAD><STYLE TYPE="text/css"></STYLE><TITLE></TITLE></HEAD><BODY bgcolor="#9F9F9F" ><FONT FACE="arial, helvetica, sans-serif"><LEFT><TABLE bgcolor="#FFFFFF" Border=2><TR><TD Align=Right bgcolor="#DFDED0">
</TD><TD Align=Center bgcolor="#DFDED0">
A</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
1</TD><TD Align=Right >C:MySiteaccessing-biz-services_.pdf</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
2</TD><TD Align=Right >C:MySiteDirect Debit Form.pdf</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
3</TD><TD Align=Right >C:MySiteGMShare.pdf</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
4</TD><TD Align=Right >C:MySiteOverview Ops Improvement12.01.pdf</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
5</TD><TD Align=Right >C:MySitereadme.pdf</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
6</TD><TD Align=Right >C:MySiteshorteval.pdf</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
7</TD><TD Align=Right >C:MySiteSpreadSheet Modelling Best Practice.pdf</TD></TR><TR><TD Align=Right bgcolor="#DFDED0">
8</TD><TD Align=Right >C:MySitetemplates2.pdf</TD></TR></TABLE></LEFT></BODY>
This table was created by a free Excel macro written by <A HREF ="MAILTO:charlie@balch.org">Charles Balch</A>Here's the <A HREF = "http://www.gwds.co.nz/">code</A>. It is care ware - it's yours for free if do something nice for anyone.
Amended @ <A HREF = "http://www.gwds.co.nz/">
http://www.gwds.co.nz/ </A>. This File is currently - being amended for the Boards users by <A HREF = "MAILTO:ivanmoala@xtra.co.nz">Ivan F Moala</A>.
</HTML>
If so then this may help you;
<pre/>
Option Explicit
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal Hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub Open_Pdf_FromList()
Dim sPdfFile As String
Dim sFDir As String
Dim X
'// Get Full PDF FileName from Activecell
sPdfFile = ActiveCell.Text
If sPdfFile = "" Then GoTo Check1
If Dir(sPdfFile) = "" Then GoTo Check2
'// Get Directory name Only
X = Split(sPdfFile, Application.PathSeparator)
ReDim Preserve X(0 To UBound(X) - 1)
sFDir = Join(X, Application.PathSeparator) & Application.PathSeparator
'// Get FileName Only
X = Split(sPdfFile, Application.PathSeparator)
sPdfFile = X(UBound(X))
'// Now Open PDF File
ShellExecute 0, "Open", sPdfFile, "", sFDir, 1
Exit Sub
Check1:
MsgBox "Cell is Empty!"
Exit Sub
Check2:
MsgBox sPdfFile & vbCrLf & vbCrLf & "Is not valid or does not exist"
End Sub
</pre>
Just select the cell reference and run this macro.....