View Full Version : Open a pdf with filesearch


twister007
06-28-2006, 01:07 AM
Hello,

How can I open the the pdf file that I found with the script below.

Private Sub pdf_Click()

Dim stAppName$, stPathName$
Start = Me!art_Art_ID
stAppName = "F:\apps\Adobe\AcroRd32.exe "
stPathName = "F:\data\documentatie\tekeningen\"
stFileName = Start & "*" & ".pdf"

Set fs = Application.FileSearch
With fs
.LookIn = stPathName
.FileName = stFileName
.SearchSubFolders = True
If .Execute > 0 Then

????????????????????(I would like to use stAppname to open the pdf)

Exit Sub

Else
MsgBox "There were no files found."
End If
End With

End Sub


Thanks!

tlwaltz
10-26-2006, 02:24 PM
You should be able to use the Shell command to open that .pdf file.


Shell stAppName & stPathName, vbNormalFocus

where:
stAppName = "F:\apps\Adobe\AcroRd32.exe "
stPathName = the complete pathname of your .pdf file