I'm trying to open .pdf documents with VBA currently I am using the shell command as such:
test = "APPLICATION PATH FOR ACROBAT 9, PDF FILE PATH)
procID = shell(test, vbNormalFocus)
which works fine, but if the path for acrobat changes or the version changes, which it will inevitably, the code won't work anymore without the application path being changed.
I'm looking for a way to scrap the application path and just tell access to open the pdf but use the computers default application to open it and thus eliminating the need to have the path inscribed in the coding.
The alternitave and slightly longer way round would be to have a line of code to work out what the application path is (a bit like the Left(CurrentDb.Name, InStrRev(CurrentDb.Name, "\")) line to generate the path that the Access database is) and use that in the test string. I’m not sure how possible this is.
Any thoughts?
test = "APPLICATION PATH FOR ACROBAT 9, PDF FILE PATH)
procID = shell(test, vbNormalFocus)
which works fine, but if the path for acrobat changes or the version changes, which it will inevitably, the code won't work anymore without the application path being changed.
I'm looking for a way to scrap the application path and just tell access to open the pdf but use the computers default application to open it and thus eliminating the need to have the path inscribed in the coding.
The alternitave and slightly longer way round would be to have a line of code to work out what the application path is (a bit like the Left(CurrentDb.Name, InStrRev(CurrentDb.Name, "\")) line to generate the path that the Access database is) and use that in the test string. I’m not sure how possible this is.
Any thoughts?