Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Acrobat file from a form

Status
Not open for further replies.

Cjbuechler

IS-IT--Management
Dec 12, 2001
19
0
0
US
I have a table of data, one column of which is the path to an adobe acrobat file per entry. How do I put a field or button on my form that when clicked will open the corresponding acrobat file??

I tried putting in a hyperlink to it but it doesn't seem to work...any ideas??
 
Use the follow or follow hyperlink method. A third alternative is to use Shell.

Uncle Jack
 
Of course, several avenues here. What I usually do is create a list box on the form which displays the document file paths that are found, in this case *.pdf files, and then query a temporary table sending the recovered paths to the list box. User then clicks on an Acrobat button which is hyperllinked to the path in the list box. An example:

With Application.FileSearch
.NewSearch
.LookIn = "C:\MyDirectory\PDF\" 'path to files
.FileName = "INV*.pdf" 'query file type
.MatchAllWordForms = True
If .Execute() > 0 Then
For I = 1 To .FoundFiles.Count
Set MyDb = DBEngine.Workspaces(0).Databases(0)
Set MySet = MyDb.OpenRecordset("tblYourtemptable")
MySet.AddNew
MySet![Name] = .FoundFiles(I) 'Name in temp table
MySet.Update
MySet.Close
MyDb.Close
Next I
Else
MsgBox "There were no files found."
End If

...thought you might consider this. Again, one temporary table, one list box which has its row source on this table, and filling the table each time a search is carried out for the *pdf files on the hard drive, and then clicking on the button on the form to open up the Acrobat file. Note you could eliminate button and hyperlink on a double click event on the list box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top