Open a pdf with filesearch

  • Thread starter Thread starter twister007
  • Start date Start date
T

twister007

Guest
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!
 
Use the Shell command to open that .pdf file

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
 

Users who are viewing this thread

Back
Top Bottom